<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Edit legend label or description with python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/edit-legend-label-or-description-with-python/m-p/165156#M12692</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The layer.description property is the layer's metadata description you would find if you right-clicked on a layer in the TOC, clicked properties and looked at the General tab.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At 10.1 a subset of symbology types were exposed: GraduatedColors, GraduatedSymbols, RasterClassified and UniqueValue:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.1/#/GraduatedColorsSymbology/00s30000005z000000/" rel="nofollow" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.1/#/GraduatedColorsSymbology/00s30000005z000000/&lt;/A&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.1/#/GraduatedSymbolsSymbology/00s30000005q000000/" rel="nofollow" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.1/#/GraduatedSymbolsSymbology/00s30000005q000000/&lt;/A&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.1/#/RasterClassifiedSymbology/00s30000005p000000/" rel="nofollow" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.1/#/RasterClassifiedSymbology/00s30000005p000000/&lt;/A&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.1/#/UniqueValuesSymbology/00s30000005s000000/" rel="nofollow" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.1/#/UniqueValuesSymbology/00s30000005s000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you are using one of these renderers, you can change the labels and/or descriptions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Mar 2013 13:20:30 GMT</pubDate>
    <dc:creator>JeffBarrette</dc:creator>
    <dc:date>2013-03-20T13:20:30Z</dc:date>
    <item>
      <title>Edit legend label or description with python</title>
      <link>https://community.esri.com/t5/python-questions/edit-legend-label-or-description-with-python/m-p/165155#M12691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In a nut shell, If anyone knows how to change the text in legend labels in arcpy let me know.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is what I have tried so far...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to edit the description of the layer using the layer.description method and then setting the legend item's style to one that uses the description as the primary legend label. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can set the style property and when I print the layer's description to the terminal it appears to be set, however when I open the mxd, the description isn't filled out (under the symbology tab of the layer's properties).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's a sample of my code&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;for item in mxdlist: &amp;nbsp;&amp;nbsp;&amp;nbsp; if ".mxd" in item: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; figpath = path + item &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd = arcpy.mapping.MapDocument(figpath) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for item in arcpy.mapping.ListLayers(mxd): &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if "RIPRAP" in item.name: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; item.description = 'Rip Rap' &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "....Updated" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print item.description &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; legend = arcpy.mapping.ListLayoutElements(mxd, "LEGEND_ELEMENT", "Legend")[0] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; legendlayers = legend.listLegendItemLayers() &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for item in legendlayers: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if "RIPRAP" in item.name: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; style = arcpy.mapping.ListStyleItems("USER_STYLE", "Legend Items","blobDesc")[0] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; legend.updateItem(item, style) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print item.name &amp;nbsp;&amp;nbsp;&amp;nbsp; mxd.save() &amp;nbsp;&amp;nbsp;&amp;nbsp; del mxd&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think that the layer property for description isn't what I think it is, but maybe somebody else knows what I am missing. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 17:30:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/edit-legend-label-or-description-with-python/m-p/165155#M12691</guid>
      <dc:creator>JasonTaylor</dc:creator>
      <dc:date>2013-03-19T17:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: Edit legend label or description with python</title>
      <link>https://community.esri.com/t5/python-questions/edit-legend-label-or-description-with-python/m-p/165156#M12692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The layer.description property is the layer's metadata description you would find if you right-clicked on a layer in the TOC, clicked properties and looked at the General tab.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At 10.1 a subset of symbology types were exposed: GraduatedColors, GraduatedSymbols, RasterClassified and UniqueValue:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.1/#/GraduatedColorsSymbology/00s30000005z000000/" rel="nofollow" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.1/#/GraduatedColorsSymbology/00s30000005z000000/&lt;/A&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.1/#/GraduatedSymbolsSymbology/00s30000005q000000/" rel="nofollow" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.1/#/GraduatedSymbolsSymbology/00s30000005q000000/&lt;/A&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.1/#/RasterClassifiedSymbology/00s30000005p000000/" rel="nofollow" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.1/#/RasterClassifiedSymbology/00s30000005p000000/&lt;/A&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.1/#/UniqueValuesSymbology/00s30000005s000000/" rel="nofollow" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.1/#/UniqueValuesSymbology/00s30000005s000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you are using one of these renderers, you can change the labels and/or descriptions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2013 13:20:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/edit-legend-label-or-description-with-python/m-p/165156#M12692</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2013-03-20T13:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: Edit legend label or description with python</title>
      <link>https://community.esri.com/t5/python-questions/edit-legend-label-or-description-with-python/m-p/165157#M12693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Awesome, thanks for the tip. I hadn't thought to look for label editing in those functions because my feature uses the single symbol renderer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2013 15:31:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/edit-legend-label-or-description-with-python/m-p/165157#M12693</guid>
      <dc:creator>JasonTaylor</dc:creator>
      <dc:date>2013-03-21T15:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Edit legend label or description with python</title>
      <link>https://community.esri.com/t5/python-questions/edit-legend-label-or-description-with-python/m-p/165158#M12694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It would be a work around but you could add a field to your table, calculate all values to be the same and then use the unique value renderer to symbolize the single symbol.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Mar 2013 13:07:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/edit-legend-label-or-description-with-python/m-p/165158#M12694</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2013-03-22T13:07:44Z</dc:date>
    </item>
  </channel>
</rss>

