Discrete color scale for plotly graph object
21:00 04 Sep 2022

I'm trying to plot a choropleth map with discrete colorbar (including the label), like this picture

enter image description here

But all I have found so far is doing this using plotly express. I have to use plotly graph objects because I have multiple traces containing different types of plots. So is there any color_discrete_sequence equivalence for plotly graph objects? Thanks in advance.

python plotly