Via*_*ain 6 python plotly sunburst-diagram plotly-python
我正在尝试绘制旭日图,但有些项目太小而看不见。
例如:这段代码...
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, 1, 12, 10, 2, 25, 6, 4, 1],
branchvalues="total",
sort = False
))
Run Code Online (Sandbox Code Playgroud)
...给我 :
我可以隐藏这样的小物品:
fig.update_layout(
title_text=f"biblical family",
uniformtext=dict(minsize=8, mode='hide'),
width=900, height=700
)
Run Code Online (Sandbox Code Playgroud)
在这里,我使用了Fig.add_annotation
fig.add_annotation(
text=f'Azura',
xanchor='right',
x=0.41, y=0.21,
ax=-100, ay=90)
Run Code Online (Sandbox Code Playgroud)
但是,有没有办法显示太小而无法打印在图表之外的外部项目?无需手工操作:p
或者至少,捕获每个切片中心的位置,这样我就可以自动使用Fig.add_annotation?:D
非常感谢你:D