| [ Web Proxy ] |
| Viewing: https://matplotlib.org/stable/api/_as_gen/../_as_gen/../_as_gen/matplotlib.patches.Rectangle.html | [Back] [Original] |
Bases: Patch
A rectangle defined via an anchor point xy and its width and height.
The rectangle extends from xy[0] to xy[0] + width in x-direction
and from xy[1] to xy[1] + height in y-direction.
: +------------------+
: | |
: height |
: | |
: (xy)---- width -----+
One may picture xy as the bottom left corner, but which corner xy is actually depends on the direction of the axis and the sign of width and height; e.g. xy would be the bottom right corner if the x-axis was inverted or if width was negative.
The anchor point.
Rectangle width.
Rectangle height.
Rotation in degrees anti-clockwise about the rotation point.
If 'xy', rotate around the anchor point. If 'center' rotate
around the center. If 2-tuple of number, rotate around this
coordinate.
Patch propertiesProperty |
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 |
See also
FancyBboxPatchA rectangle with a fancy box style, e.g. rounded corners.
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.
The rotation point of the 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)
a.set_c(C)
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
unknown
bool
antialiasedoraabool or None
(left, bottom, width, height)
CapStyleor {'butt', 'projecting', 'round'}
BboxBaseor Nonebool
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
unknown
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
unknown
unknown
(float, float)
unknown
float
Set the rotation angle in degrees.
The rotation is performed anti-clockwise around xy.
Set the bounds of the rectangle as left, bottom, width, height.
The values may be passed as separate parameters or as a tuple:
set_bounds(left, bottom, width, height)
set_bounds((left, bottom, width, height))
Set the left and bottom coordinates of the rectangle.
Return the left and bottom coords of the rectangle as a tuple.
matplotlib.patches.Rectangle#Create boxes from error bars using PatchCollection
| Web Proxy Viewer | New URL | Original Page |