4

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>',
        

)

enter image description here Also, my Sankey Diagram code set up is similar to the answer to this stack overflow question: Plotly Sankey diagram group label and color

carsof
  • 83
  • 1
  • 8

1 Answers1

4

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.

AS11
  • 1,311
  • 1
  • 7
  • 17