I have a Jupyter Notebook in my ArcGIS Pro project which changes the symbology of my map layer. In this script I manually set the class breaks using the classBreakValues
variable which works as long as the list starts from the lowest number (3) to the highest (15). Example below:
from datetime import datetime # for obtaining today's date
import os
# set up project and map
p = arcpy.mp.ArcGISProject('CURRENT')
m = p.listMaps('Map')[0]
lyr = m.listLayers('PHUC4s_joinedData')[0]
Layout = p.listLayouts('Layout')[0]
# create a list of fields
fields = arcpy.ListFields(lyr) # creates a list of fields
# create the outputs
sym.updateRenderer('SimpleRenderer') # reset renderer
sym.updateRenderer('GraduatedColorsRenderer')
sym.renderer.classificationField = 'complete_data.csv.Ind_RegRank_pctRank'
sym.renderer.breakCount = 4
sym.renderer.colorRamp = p.listColorRamps('Oranges (Continuous)')[0]
## general change for most legends
classBreakValues = [3, 7, 10, 15]
classBreakLabels = ['3', '7', '10', '15']
label_loop_count = 0
for brk in sym.renderer.classBreaks:
brk.upperBound = classBreakValues[label_loop_count]
brk.label = classBreakLabels[label_loop_count]
label_loop_count += 1
# save symbology back into the layer
lyr.symbology = sym
Now the issue is that I want to reverse the color scheme so that the lowest numbers are the darkest. I tried to change classBreakValues
to [15, 10, 7, 3]
to reverse the color order but the outcome is just a single-colored map set to whatever color is set to 15.
This map is an example output from the code I posted above. Here I have classBreakValues = [3, 7, 10, 15].
If I try to reverse the colors with classBreakValues = [15, 10, 7, 3]
I end up with a map only filled with that white color. My ultimate goal is to just reverse the color order.