Code SampleGraduatedColorsSymbology example 1The following script modifies the symbology for all graduated colors layers in a map document. It iterates through each layer, changes the value field and the number of classes, and saves the map document.import arcpy mxd = arcpy.mapping.MapDocument(r"C:\Project\Project.mxd") for lyr in arcpy.mapping.ListLayers(mxd): if lyr.symbologyType == "GRADUATED_COLORS": lyr.symbology.valueField = "POP2007" lyr.symbology.numClasses = 5 del mxd
import arcpy mxd = arcpy.mapping.MapDocument(r"C:\Project\Project.mxd") for lyr in arcpy.mapping.ListLayers(mxd): if lyr.symbologyType == "GRADUATED_COLORS": lyr.symbology.valueField = "POP2007" lyr.symbology.numClasses = 5 del mxd
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.