Using values
in a plotly sunburst we can control the width of the leaf nodes. How can we adjust the height?
import plotly.graph_objects as go
# Define your custom hierarchy
labels = ["Root", "A", "B", "C", "D", "E", "AA", "AB", "BA", "AAA", "AAB"]
parents = ["", "Root", "Root", "A", "A", "Root", "Root", "A", "B", "AA", "AA"]
values = [10, 14, 12, 10, 2, 6, 6, 4, 4, 2, 1]
# Create the sunburst chart
fig = go.Figure(go.Sunburst(
labels=labels,
parents=parents,
values=values,
))
# Customize the layout (optional)
fig.update_layout(
margin=dict(t=0, l=0, r=0, b=0),
sunburstcolorway=["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd"],
)
fig.show()