In ArcMap Style Manager, I have a Preset Color Ramp defined. I would like to control how the colors are applied when doing Add All Values, but it seems colors in the set are applied at random and differently in ArcMap and with arcpy.mapping.
When I apply the ramp from ArcMap, Layer Properties, Symbology, Add All Values, these are the results:
When I apply the ramp using arcpy.mapping and lyr.symbology.addAllValues(), these are the results:
It is a totally different set of colors, the orange from the first image and brown from the second are different. I have a Python automated map export process and I would like some consistency in how colors are applied for this layer.
Does anyone have a way to make this more consistent?
Here is the code snippet:
templateMxd = r'D:\...\biodiv_npc_map.mxd'
mxd = arcpy.mapping.MapDocument(templateMxd)
df = arcpy.mapping.ListDataFrames(mxd)[0]
lyrList = arcpy.mapping.ListLayers(mxd, "*", df)
for lyr in lyrList:
if lyr.name == "Mapped Native Plant Communities near or on property":
lyr.symbology.addAllValues()
arcpy
code. Don't you need to update the symbology using.lyr
file for which a color ramp is defined?