从堆积图中获取颜色
Get colors from stacked plot
我有这个 Plotly 图(敏感数据模糊):
我使用 fig = px.bar(stacked, x='Data', y='Kwota', color='Kategoria')
来自 plotly_express
。
有没有办法获取自动用于类别的颜色?
根据:
[...] 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']
我有这个 Plotly 图(敏感数据模糊):
我使用 fig = px.bar(stacked, x='Data', y='Kwota', color='Kategoria')
来自 plotly_express
。
有没有办法获取自动用于类别的颜色?
根据
[...] the default sequence comes from
layout.colorway
in the active template.In the default template called
plotly
this is the sequence available underpx.colors.qualitative.Plotly
.This sequence is
['#636EFA', '#EF553B', '#00CC96', '#AB63FA', '#FFA15A', '#19D3F3', '#FF6692', '#B6E880', '#FF97FF', '#FECB52']