<?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: Change Legend Font Size and Fitting Strategy with ArcPy in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/change-legend-font-size-and-fitting-strategy-with/m-p/1087862#M44320</link>
    <description>&lt;P&gt;Apologies Mehdi,&lt;/P&gt;&lt;P&gt;I was pulled onto some other projects and have only just gotten back to this thread!&lt;/P&gt;&lt;P&gt;I tried the supplied code, however while I observed the fitting strategy set to "Adjust Columns and Font", and the legend size changes to 40w and 20h, neither the legend size changes, nor do any of the font sizes seem to change. Am I doing something wrong?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DavidField_0-1628685326268.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/20619i83539AC2DE8C7852/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DavidField_0-1628685326268.png" alt="DavidField_0-1628685326268.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I am sure this has been uttered many times before on these forums, but does anyone know why on Earth ArcGIS Pro arcpy doesn't have a "fontSize" property?!?!&lt;/P&gt;</description>
    <pubDate>Wed, 11 Aug 2021 12:37:29 GMT</pubDate>
    <dc:creator>DavidField</dc:creator>
    <dc:date>2021-08-11T12:37:29Z</dc:date>
    <item>
      <title>Change Legend Font Size and Fitting Strategy with ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/change-legend-font-size-and-fitting-strategy-with/m-p/1024700#M37058</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm pretty new to ArcPy and am having with what is probably a fairly simple task. I'm trying to change the fitting strategy of a legend in a layout called "Test_Layout", and then change the font size of all elements in the legend to 8. Here is my code so far:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;aprx = arcpy.mp.ArcGISProject("CURRENT")&lt;BR /&gt;lyt = aprx.listLayouts("Test_Layout")[0]&lt;BR /&gt;leg = lyt.listElements("LEGEND_ELEMENT")[0]&lt;BR /&gt;leg.fittingStrategy = "AdjustFrame"&lt;BR /&gt;for elm in leg.items:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; fontSize = 8&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is anyone able to tell me what I'm doing wrong?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 01:17:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/change-legend-font-size-and-fitting-strategy-with/m-p/1024700#M37058</guid>
      <dc:creator>DavidField</dc:creator>
      <dc:date>2021-02-09T01:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: Change Legend Font Size and Fitting Strategy with ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/change-legend-font-size-and-fitting-strategy-with/m-p/1024794#M37066</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/124066"&gt;@DavidField&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;You can use element height and width to change the font size and legend size since &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/legenditem-class.htm" target="_self"&gt;LegendItem&lt;/A&gt; does not have fontSize property.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;....
leg.fittingStrategy = "AdjustColumnsAndFont"
print(leg.elementHeight, leg.elementWidth)
40.57 75.59

leg.elementHeight = 20
leg.elementWidth = 40&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;This is the reference link for LegendElement::&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/legendelement-class.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/legendelement-class.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Mehdi&lt;/P&gt;&lt;P&gt;======================================================================&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Please give a like if helpful and Accept as Solution if it's answered your query.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 08:23:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/change-legend-font-size-and-fitting-strategy-with/m-p/1024794#M37066</guid>
      <dc:creator>MehdiPira1</dc:creator>
      <dc:date>2021-02-09T08:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: Change Legend Font Size and Fitting Strategy with ArcPy</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/change-legend-font-size-and-fitting-strategy-with/m-p/1087862#M44320</link>
      <description>&lt;P&gt;Apologies Mehdi,&lt;/P&gt;&lt;P&gt;I was pulled onto some other projects and have only just gotten back to this thread!&lt;/P&gt;&lt;P&gt;I tried the supplied code, however while I observed the fitting strategy set to "Adjust Columns and Font", and the legend size changes to 40w and 20h, neither the legend size changes, nor do any of the font sizes seem to change. Am I doing something wrong?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DavidField_0-1628685326268.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/20619i83539AC2DE8C7852/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DavidField_0-1628685326268.png" alt="DavidField_0-1628685326268.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I am sure this has been uttered many times before on these forums, but does anyone know why on Earth ArcGIS Pro arcpy doesn't have a "fontSize" property?!?!&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 12:37:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/change-legend-font-size-and-fitting-strategy-with/m-p/1087862#M44320</guid>
      <dc:creator>DavidField</dc:creator>
      <dc:date>2021-08-11T12:37:29Z</dc:date>
    </item>
  </channel>
</rss>

