matplotlib.patches.Polygon
- class matplotlib.patches.Polygon(xy, *, closed=True, **kwargs)
Bases:
PatchA general polygon patch.
- Parameters
Bases: Patch
A general polygon patch.
Whether the polygon is closed (i.e., has identical start and end points).
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 | |
| 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 |
Return whether the polygon is closed.
Get the Path of the polygon.
Get the vertices of the path.
The coordinates of the vertices.
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 whether the polygon is closed.
True if the polygon is closed
Set the vertices of the polygon.
The coordinates of the vertices.
Unlike Path, we do not ignore the last input vertex. If the
polygon is meant to be closed, and the last point of the polygon is not
equal to the first, we assume that the user has not explicitly passed a
CLOSEPOLY vertex, and add it ourselves.
The vertices of the path as a (N, 2) array.
matplotlib.patches.PolygonControlling view limits using margins and sticky_edges
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
bool
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
(N, 2) array-like
float