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
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.