每当我制作一张绘出的太阳暴击图(我使用Python)时,最外层的“圆”或“环”比其他太阳暴击环要轻得多。我怎么能让这个戒指的阴影和图表上的其他部分一样呢
如您所见,标记为Bb5的段比其他段轻
我使用的是标准的Plotly sunburst代码。简单示例(无论如何都将使用浅色):
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=[10, 14, 12, 10, 2, 6, 6, 4, 4],
))
# Update layout for tight margin
# See https://plotly.com/python/creating-and-updating-figures/
fig.update_layout(margin = dict(t=0, l=0, r=0, b=0))
fig.show()
您正在寻找:
这将设置树叶的不透明度。对于指定的colorscale,它默认为
1
,否则默认为0.7
绘图1:
leaf=dict(opacity=1)
现在,将其与:
绘图2:
leaf=None
现在,不透明度默认为
0.7
看看当您为
colorscale
指定了一个值时会发生什么:绘图3:
colorscale='RdBu'
如果省略叶参数,则叶的图形默认为不透明度=1:
最后,您可以通过
colorscale
和leaf=dict(opacity=0.2)
两种方式使用它。我只是将不透明度设置得很低,以明确一点:以下是您要查找的案例的完整代码:
相关问题 更多 >
编程相关推荐