✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚡️ Concerned about the grid? Kyle Baranko teaches how to predicting peak loads using XGBoost. Register for the August webinar!

Discrete Colors in Plotly.graph_objects

Hi everyone,

I am trying to make a bar graph in which each bar is composed of stacked smaller bars. Each smaller bar is representative of one ship’s contribution to the total value on a particular date. I want to have a unique color for each ship’s contribution throughout the time period being shown. In the plotly.express bar graph, the color attribute allows this, but I am trying to do this with a plotly.graph_objects figure. The graph itself is composed of hundreds of ships, so adding a separate trace for each ship seems really time inefficient, because all of the data is stored together. Any advice on this matter would be greatly appreciated!