Geographic Information Systems Asked by K_atarina on February 18, 2021
I have created this map in PyCharm with Arcpy software, and was wondering if there is a code I can use to remove the ‘High’ and ‘Low’ labels and just show the numeric values in the legend. Using ArcMap version 10.7.1.
Here is a sample of the code I’ve used to edit items in the legend:
#Using Style Manager to edit the appearance of the Legend
#edit study area in legend
mxd1 = arcpy.mapping.MapDocument(r"C:UsersWindowsDesktoptestmapmap_test.mxd")
df1 = arcpy.mapping.ListDataFrames(mxd1, "Layers")[0]
lyr1 = arcpy.mapping.ListLayers(mxd1, "Noise (dBA)", df1)[0]
styleItem = arcpy.mapping.ListStyleItems("C:UsersWindowsAppDataRoamingESRIDesktop10.7ArcMapWindows.style", "Legend Items", "Noise (dBA)")[0]
legend = arcpy.mapping.ListLayoutElements(mxd1, "LEGEND_ELEMENT", "Legend")[0]
legend.updateItem(lyr1, styleItem)
mxd1.save()
I have also used the ‘apply symbology from layer’ tool, but this did not effect or change the labels.
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP