Select to view content in your preferred language

set color in MatrixHeat chart

362
2
03-22-2023 01:41 PM
DavidAnderson_1701
Occasional Contributor

I am using the arcpy.charts module to create some MatrixHeat charts for a set of data.  I can't  figure out how to change the color from the default color.  Setting the color property

my_chart.color = ['#FF3333']

Doe not change the color.  The documentation on this is vague bordering on nonexistent.  Checking the docstring

my_chart.color?

comes back with <no docstring>

 

0 Kudos
2 Replies
wizgis
by
Occasional Contributor II

Hi @DavidAnderson_1701 

Greetings, 

I little digging on this and came across this blog article https://www.esri.com/arcgis-blog/products/arcgis-pro/analytics/using-arcgis-notebooks-and-arcpy-char... and it looks like it is possible to change colors however, looks like it is only for line chart. 

Additionally, I also tried creating a matrix heat chart in arcgis pro itself and in the UI we do have the option to change the color scheme. Attaching a screenshot for your reference 

Chart.png

 

I know in open source libraries like seaborn we do have a parameter of cmap  to change colors. (https://seaborn.pydata.org/generated/seaborn.heatmap.html).

Hence, I also tried using parameters like cmap or name of a color scheme as mentioned in pro in the jupyter notebook to see if that changes color in the chart however, it still shows the default color. 

Test.png

 

At this point of time I believe if possible you can check with ESRI Technical Support to confirm if this functionality is available in arcpy. 

As a workaround and if possible you can leverage open source libraries. 

Hope this helps.

0 Kudos
DavidAnderson_1701
Occasional Contributor

Thanks.  I have already explored the options shown in this response.  I even tried using a color ramp name also in trying to set the color scheme.

I have had ESRI staff pop in on other threads, maybe one will read this and respond to this post.

 

 

0 Kudos