2

I have this Plotly plot (blurred sensitive data): plot

which I got using fig = px.bar(stacked, x='Data', y='Kwota', color='Kategoria') from plotly_express.

Is there a way to obtain the colors which were automatically used for categories?

alex
  • 10,900
  • 15
  • 70
  • 100

1 Answers1

0

As per this recent answer:

[...] the default sequence comes from layout.colorway in the active template.

In the default template called plotly this is the sequence available under px.colors.qualitative.Plotly.

This sequence is ['#636EFA', '#EF553B', '#00CC96', '#AB63FA', '#FFA15A', '#19D3F3', '#FF6692', '#B6E880', '#FF97FF', '#FECB52']

alex
  • 10,900
  • 15
  • 70
  • 100
  • I understood your question more along the lines of being able to read that information out of your plot *directly*. But I was planning to link the information from nicolaskruchten (since I was the one to raise that question) to my original answer here too. In any case I'm glad you got the information you needed. – vestland Jan 19 '20 at 21:59
  • @vestland Oops, sorry for the poor phrasing. And thank you for posting an answer anyway! – alex Jan 19 '20 at 22:05