Saurav
Saurav

Reputation: 75

How can we increase the tail of the arrow in Plotly?

How can I increase the tail of the arrow in Plotly so that the text, here 1st Lockdown,2nd Lockdown,3rd Lockdown and 4th Lockdown written is distinguishable and doesn't come in between the Line Chart?

enter image description here

Upvotes: 0

Views: 1933

Answers (1)

Vinit Neogi
Vinit Neogi

Reputation: 386

You can use the update_annotations method: https://plotly.com/python/text-and-annotations/

fig.update_annotations(dict(
            xref="x",
            yref="y",
            showarrow=True,
            arrowhead=7,
            ax=0,
            ay=-40
))

For the parameter, ay you can try different values: -100, -150, -200, etc and you will get results like below. enter image description here

You can tune the position further as you want.

Upvotes: 3

Related Questions