diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 0cba4d225e36..17bff4ad7717 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -4522,13 +4522,34 @@ def arrow(self, x, y, dx, dy, **kwargs): """ Add an arrow to the axes. - Call signature:: + Draws arrow on specified axis from (`x`, `y`) to (`x` + `dx`, + `y` + `dy`). Uses FancyArrow patch to construct the arrow. + + Parameters + ---------- + x : float + X-coordinate of the arrow base + y : float + Y-coordinate of the arrow base + dx : float + Length of arrow along x-coordinate + dy : float + Length of arrow along y-coordinate + + Returns + ------- + a : FancyArrow + patches.FancyArrow object - arrow(x, y, dx, dy, **kwargs) + Other Parameters + ----------------- + Optional kwargs (inherited from FancyArrow patch) control the arrow + construction and properties: - Draws arrow on specified axis from (*x*, *y*) to (*x* + *dx*, - *y* + *dy*). Uses FancyArrow patch to construct the arrow. + %(FancyArrow)s + Notes + ----- The resulting arrow is affected by the axes aspect ratio and limits. This may produce an arrow whose head is not square with its stem. To create an arrow whose head is square with its stem, use @@ -4537,13 +4558,11 @@ def arrow(self, x, y, dx, dy, **kwargs): ax.annotate("", xy=(0.5, 0.5), xytext=(0, 0), arrowprops=dict(arrowstyle="->")) - Optional kwargs control the arrow construction and properties: - - %(FancyArrow)s - - **Example:** + Examples + -------- .. plot:: mpl_examples/pylab_examples/arrow_demo.py + """ # Strip away units for the underlying patch since units # do not make sense to most patch-like code