问题描述
我目前正在尝试制作具有四个环的Plotly朝阳图。我希望前三个内环为浅蓝色,最外环为橙色。
我使用的代码是:
fig = px.sunburst(
data,path=['column','column2','column3','column 4'],values='column4')
fig.show()
非常感谢您的帮助!
解决方法
设置标记的颜色应该可以:
在javascript中:
data = [{
type: "sunburst",labels: ["ring1","ring2","ring3","ring4"],parents: ["","ring1","ring3"],marker: {
colors: [ "steelblue","steelblue","orange"]
},}];
Plotly.newPlot('plotlyDiv1',data);