I want to get the relative width (0~1) of the rightest nodes in Sankey diagram.
Hereโs an example:
import plotly.graph_objects as go
fig = go.Figure(data=[go.Sankey(
node = dict(
pad = 15,
thickness = 20,
line = dict(color = "black", width = 0.5),
label = ["A1", "A2", "B1", "B2", "C1", "C2"],
color = "blue"
),
link = dict(
source = [0, 1, 0, 2, 3, 3], # indices correspond to labels, eg A1, A2, A1, B1, ...
target = [2, 3, 3, 4, 4, 5],
value = [8, 4, 2, 8, 4, 2]
))])
fig.update_layout(font_size=60)
fig.show()
How to get the relative height (0~1) of C1
and C2
in the final figure? Because I want to create bar plots that have the same height as C1 and C2, I need the actual/final height which may be affected by the font size.