【发布时间】:2021-04-02 16:12:53
【问题描述】:
我想控制下面 Sunburst 图中每个标签的颜色 - 当使用 plotly.graph_objects 而不是 plotly.express 时。
参见下面documentation 的示例:
import plotly.graph_objects as go
fig =go.Figure(go.Sunburst(
labels=[ "Eve", "Cain", "Seth", "Enos", "Noam", "Abel", "Awan", "Enoch", "Azura"],
parents=["", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve" ],
values=[ 65, 14, 12, 10, 2, 6, 6, 4, 4],
branchvalues="total",
))
fig.update_layout(margin = dict(t=0, l=0, r=0, b=0))
fig.show()
【问题讨论】:
标签: python colors plotly sunburst-diagram