How to resize double head head in matplotlib?

The figure below shows a graph from which the arrow is very small ... enter image description here

I tried under the code, but it didn’t work ... he said: "Raise AttributeError (" Unknown property% s "% k) AttributeError: Unknown property headwidth" ...

xyfrom=[10,620]
xyto=[130,620]
ax.annotate("",xyfrom,xyto,arrowprops=dict(arrowstyle='<->',linewidth = 2,     headwidth=10,color = 'k'
))
ax.text((xyto[0]+xyfrom[0])/2-15,(xyto[1]+xyfrom[1])/2+10,"headwidth is too    small",fontsize=24)
+1
source share
1 answer

I believe in this because you need to give arrowstyle arguments inside the line. Try the following:

 arrowprops=dict(arrowstyle='<->, head_width=10', facecolor='k')

notice how this is the full line:

 '<->, head_width=10'

This is a really weird choice in matplotlib, one I really don't understand why it should be. In any case, see if your problem solves.

+3
source

All Articles