I scratch my head on everything that would seem to be an easy problem. I am trying to just adjust the width of an arrow arrow in Matplotlib.
Here's the 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 he depicts a beautiful double-headed arrow, as shown. Now that I want to change the bandwidth 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))
Error returned:
AttributeError: Unknown property headwidth
or
AttributeError: Unknown property head_width
It seems that I cannot find any resources through Google that solve this simple problem. Is there a way out?
Thank you very much for your time and attention!