python - How to change arrow head width and length of CurveB in matplotlib? -
i trying create annotations arrow code given below:
import matplotlib.pyplot plt figure = plt.figure(figsize=(5.15, 5.15)) figure.clf() plot = plt.subplot(111) plot.set_xlabel(r'\textit{x}', labelpad=6) plot.set_ylabel(r'\textit{y}', labelpad=6) plt.annotate(r'\textit{p}', xy = (0.5, 0.5), \ xycoords = 'data', xytext = (0.4, 0.4), \ textcoords = 'data', fontsize = 7, arrowprops=dict(arrowstyle = "->")) plt.show()
i tried change head width , head length follows:
arrowprops=dict(arrowstyle = "->", head_width = 0.2, head_length = 0.1)
but gives me following error:
attributeerror: 'fancyarrowpatch' object has no attribute 'set_head_width'
how change head length, head width , body width in matplotlib?
use headwidth , frac specify width , length of arrowhead.
frac the headlength written fraction total arrow length.
plt.annotate(r'\textit{p}', xy = (0.5, 0.5), \ xycoords = 'data', xytext = (0.4, 0.4), \ textcoords = 'data', fontsize = 7, arrowprops=dict(headwidth = 15, frac = 0.5))
Comments
Post a Comment