如果我使用 plotly express 子模块,我可以通过以下方式创建彩色旭日图:
import plotly.express as px
names = ["Eve", "Cain", "Seth", "Enos", "Noam", "Abel", "Awan", "Enoch", "Azura"]
parents = ["", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve" ]
values = [10, 14, 12, 10, 2, 6, 6, 4, 4]
color_discrete_sequence = ['#2D5F91', '#FFAA00', '#96BEE6', '#48B7B4', '#E8655F',
'#819FBD', '#FFCC66', '#C0D8F0', '#91D4D2', '#F1A39F']
fig = px.sunburst(
names=names,
parents=parents,
values=values,
color_discrete_sequence = color_discrete_sequence,
)
fig.show()
我想对 plotly 的 graph_objects 做同样的事情。有没有类似的功能?
森栏
相关分类