Hi all.
There is a task to make several columns with data, and then make a dash next to them - which would mark the target value.
I tried and I got this:
And it’s almost good. There was a small detail left - to paint the columns in corporate colors.
Usually, when plotting in plotly express, I use the ‘color_discrete_map=colors’ parameter, but this does not work here. I can’t paste this into add_bar or subplot options.
How to correctly set colors for each of the series in grb?
Hi,
Note that if you have a corporate color palette, you can define your own template from these colors, and set a custom colorway, so that every chart designed with either px.express or plotly.graphic_objects use this colorway.
Details are here:
Regarding your trace, if you use pltoly.graphic_objects as go, then go.Figure(), go.Bar(), you can set the color of the bar via marker.
In the example you provided above, you did not specify any color to your .add_bar traces.
ANd you have created a figure with 1 row and 1 col, so, 1 chart. Your 4 traces share the same xaxis. You don’t need to make any subplot for this.