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, yfloat
The x and y coordinates of the arrow base.
- dx, dyfloat
The length of the arrow along x and y direction.
- widthfloat, default: 0.001
Width of full arrow tail.
- length_includes_headbool, default: False
True if head is to be counted in calculating the length.
- head_widthfloat or None, default: 3*width
Total width of the full arrow head.
- head_lengthfloat 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.
- overhangfloat, default: 0
Fraction that the arrow is swept back (0 overhang means triangular shape). Can be negative or greater than one.
- head_starts_at_zerobool, default: False
If True, the head starts being drawn at coordinate 0 instead of ending at coordinate 0.
- **kwargs
Patch
properties:Property
Description
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image
unknown
bool
antialiased
oraa
bool or None
CapStyle
or {'butt', 'projecting', 'round'}BboxBase
or Nonebool
Patch or (Path, Transform) or None
color or None
color or None
bool
str
{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
unknown
bool
JoinStyle
or {'miter', 'round', 'bevel'}object
{'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
float or None
bool
list of
AbstractPathEffect
None or bool or float or callable
bool
(scale: float, length: float, randomness: float)
bool or None
str
bool
float
- Returns:
FancyArrow
The created
FancyArrow
object.
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="->"))