How to draw arrow that has legend?

@Bijan
Have you tried to plot arrows with ff.create_quiver()?

fig = ff.create_quiver(x=[0.5, 0.7], y=[1, 0.8], u=[1.2, 1.35], v=[0.9, -0.7],
                       scale=0.055,
                       arrow_scale=0.38,
                       angle=9*np.pi/180, 
                       scaleratio=1,
                       line=dict(width=1.25, color='RoyalBlue'))

fig.update_traces(fill="toself", name="arrow",  showlegend=True)
fig.update_layout(width=500, height=400)

arrows
This line

fig.update_traces(fill="toself", name="arrow",  showlegend=True)'

fills the arrow, assigns a name to your arrows, to be displayed in legend.

For more details on the arguments of the function ff.create_quiver()
print(help(ff.create_quiver))

2 Likes