I'm using python with plotly to create Sankey Diagram. this it the text for the title/subtitles & a picture of the problem (the title overlaps with the diagram). How can I create more space between the two? I've tried adding "height=#' to the layout but that changes the width of my Sankey Diagram instead.
line2="From time: "+str(time_from)+" to time: "+str(time_to)
line3="\nDATA 1:"+"{:.4f}".format(pue)
line4="\nDATA 2 :"+"{:.4f}".format(ere)
layout = dict(
title = 'TITLE HERE'+ '<br>' + '<span style="font-size: 12px;">'+line2+'</span>' + '<br>' + '<span style="font-size: 12px;">'+line3+'</span>' + '<br>' + '<span style="font-size: 12px;">'+line4+'</span>',
)
Also, my Sankey Diagram code set up is similar to the answer to this stack overflow question:
Plotly Sankey diagram group label and color
Using the code in the other question that you provided, and simply just adding this line into your code: f.update_layout(margin=dict(t=200)) you can change something like this:

into this:

You can obviously try out different values to see what works best for you, but simply adding the update_layout to change the margin for the top (t) should do the job for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With