On this page
matplotlib.axes.Axes.arrow
Axes.arrow(x, y, dx, dy, **kwargs)[source]-
Add an arrow to the axes.
This draws an arrow from
(x, y)to(x+dx, y+dy).Parameters: -
x, y : float -
The x/y-coordinate of the arrow base.
-
dx, dy : float -
The length of the arrow along x/y-direction.
Returns: -
arrow : FancyArrow -
The created
FancyArrowobject.
Other Parameters: - **kwargs
-
Optional kwargs (inherited from
FancyArrowpatch) control the arrow construction and properties: - Constructor arguments
-
- width: float (default: 0.001)
-
width of full arrow tail
- length_includes_head: bool (default: False)
-
True if head is to be counted in calculating the length.
- head_width: float or None (default: 3*width)
-
total width of the full arrow head
- head_length: float or None (default: 1.5 * head_width)
-
length of arrow head
- shape: ['full', 'left', 'right'] (default: 'full')
-
draw the left-half, right-half, or full arrow
- overhang: float (default: 0)
-
fraction that the arrow is swept back (0 overhang means triangular shape). Can be negative or greater than one.
- head_starts_at_zero: bool (default: False)
-
if True, the head starts being drawn at coordinate 0 instead of ending at coordinate 0.
- Other valid kwargs (inherited from :class:`Patch`) are:
-
Property Description agg_filtera filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array alphafloat or None animatedbool antialiasedunknown capstyle{'butt', 'round', 'projecting'} clip_boxBboxclip_onbool clip_path[( Path,Transform) |Patch| None]colorcolor containscallable edgecolorcolor or None or 'auto' facecolorcolor or None figureFigurefillbool gidstr hatch{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'} in_layoutbool joinstyle{'miter', 'round', 'bevel'} labelobject linestyle{'-', '--', '-.', ':', '', (offset, on-off-seq), ...} linewidthfloat or None for default path_effectsAbstractPathEffectpickerNone or bool or float or callable rasterizedbool or None sketch_params(scale: float, length: float, randomness: float) snapbool or None transformTransformurlstr visiblebool zorderfloat
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
annotate()for example:>>> ax.annotate("", xy=(0.5, 0.5), xytext=(0, 0), ... arrowprops=dict(arrowstyle="->")) -
© 2012–2018 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/3.0.0/api/_as_gen/matplotlib.axes.Axes.arrow.html