如何更改日暴图上光环的颜色

2024-05-28 20:17:37 发布

您现在位置:Python中文网/ 问答频道 /正文

我现在正试图用Plotly制作一张有四个光环的太阳暴流图。我希望前3个内圈是浅蓝色,最外圈是橙色

我使用的代码是:

fig = px.sunburst(
    data,
    path=['column', 'column2','column3','column 4'],
    values='column4') 
fig.show()

非常感谢你的帮助


Tags: path代码datafigcolumnplotly橙色px
1条回答
网友
1楼 · 发布于 2024-05-28 20:17:37

设置标记的颜色应执行以下操作:

在javascript中:

data = [{
  type: "sunburst",
  labels: ["ring1", "ring2", "ring3", "ring4"],
  parents: ["", "ring1", "ring2", "ring3"],
  marker: {
    colors: [ "steelblue","steelblue","steelblue", "orange"]
  },
}];

Plotly.newPlot('plotlyDiv1', data);

相关问题 更多 >

    热门问题