I am trying to adjust the headwidth
of an arrow in Matplotlib.
Here's a working code:
import numpy as np
import matplotlib.pyplot as plt
t = np.linspace(0,2*np.pi,500)
y = np.sin(t)
fig = plt.figure(figsize=(10,5))
ax = fig.add_subplot(111)
ax.plot(t,y)
ax.annotate('', xy=(1, -1), xytext=(2, 0),
arrowprops=dict(arrowstyle='<->', facecolor='black'))
And it plots a nice-looking double headed arrow as shown. Now when I want to alter the headwidth
by doing:
ax.annotate('', xy=(1, -1), xytext=(2, 0),
arrowprops=dict(arrowstyle='<->', facecolor='black',headwidth=10))
or
ax.annotate('', xy=(1, -1), xytext=(2, 0),
arrowprops=dict(arrowstyle='<->', facecolor='black',head_width=10))
The error returned is:
AttributeError: Unknown property headwidth
or
AttributeError: Unknown property head_width
Is there any way out?