matplotlib.patches.Arrow
- class matplotlib.patches.Arrow(x, y, dx, dy, *, width=1.0, **kwargs)
Bases:
PatchAn arrow patch.
Bases: Patch
An arrow patch.
Draws an arrow from (x, y) to (x + dx, y + dy). The width of the arrow is scaled by width.
x coordinate of the arrow tail.
y coordinate of the arrow tail.
Arrow length in the x direction.
Arrow length in the y direction.
Scale factor for the width of the arrow. With a default value of 1, the tail width is 0.2 and head width is 0.6.
Keyword arguments control the 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 | |
Return the Transform instance mapping patch coordinates
to data coordinates.
For example, one may define a patch of a circle which represents a radius of 5 by providing coordinates for a unit circle, and a transform which scales the coordinates (the patch coordinate) by 5.
Return the path of this patch.
Set multiple properties at once.
a.set(a=A, b=B, c=C)
is equivalent to
a.set_a(A)
a.set_b(B)
Set Arrow x, y, dx, dy and width.
Values left as None will not be updated.
The x and y coordinates of the arrow base.
The length of the arrow along x and y direction.
Width of full arrow tail.
matplotlib.patches.Arrowunknown |
bool |
| bool or None |
|
|
bool |
Patch or (Path, Transform) or None |
color or None |
color or None |
color or None |
bool |
str |
{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'} |
unknown |
color or 'edge' or None |
bool |
|
object |
{'-', '--', '-.', ':', '', ...} or (offset, on-off-seq) |
float or None |
bool |
list of |
None or bool or float or callable |
bool |
(scale: float, length: float, randomness: float) |
bool or None |
str |
bool |
float |
In addition to the full property names, aliases are also supported, e.g.
set(lw=2) is equivalent to set(linewidth=2), but it is an error
to pass both simultaneously.
The order of the individual setter calls matches the order of parameters
in set(). However, most properties do not depend on each other so
that order is rarely relevant.
Supported properties are
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
float or None
bool
antialiasedoraabool or None
CapStyleor {'butt', 'projecting', 'round'}
BboxBaseor Nonebool
Patch or (Path, Transform) or None
unknown
color or None
color or None
color or None
bool
str
{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
unknown
color or 'edge' or None
bool
JoinStyleor {'miter', 'round', 'bevel'}object
{'-', '--', '-.', ':', '', ...} or (offset, on-off-seq)
float or None
bool
list of
AbstractPathEffectNone or bool or float or callable
bool
(scale: float, length: float, randomness: float)
bool or None
str
bool
float