matplotlib.patches.Annulus#
- class matplotlib.patches.Annulus(xy, r, width, angle=0.0, **kwargs)[source]#
Bases:
PatchAn elliptical annulus.
- Parameters:
- xy(float, float)
xy coordinates of annulus centre.
- rfloat or (float, float)
The radius, or semi-axes:
If float: radius of the outer circle.
If two floats: semi-major and -minor axes of outer ellipse.
- widthfloat
Width (thickness) of the annular ring. The width is measured inward from the outer ellipse so that for the inner ellipse the semi-axes are given by
r - width. width must be less than or equal to the semi-minor axis.- anglefloat, default: 0
Rotation angle in degrees (anti-clockwise from the positive x-axis). Ignored for circular annuli (i.e., if r is a scalar).
- **kwargs
Keyword arguments control the
Patchproperties: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
antialiasedoraabool or None
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
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
- property angle#
Return the angle of the annulus.
- property center#
Return the center of the annulus.
- property radii#
Return the semi-major and semi-minor radii of the annulus.
- set(*, agg_filter=<UNSET>, alpha=<UNSET>, angle=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, capstyle=<UNSET>, center=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, edgecolor=<UNSET>, edgegapcolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, hatch_linewidth=<UNSET>, hatchcolor=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, mouseover=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, radii=<UNSET>, rasterized=<UNSET>, semimajor=<UNSET>, semiminor=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, width=<UNSET>, zorder=<UNSET>)[source]#
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 toset(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
float
bool
antialiasedoraabool or None
CapStyleor {'butt', 'projecting', 'round'}(float, float)
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
bool
JoinStyleor {'miter', 'round', 'bevel'}object
{'-', '--', '-.', ':', '', ...} or (offset, on-off-seq)
float or None
bool
list of
AbstractPathEffectNone or bool or float or callable
float or (float, float)
bool
float
float
(scale: float, length: float, randomness: float)
bool or None
str
bool
float
float
- set_radii(r)[source]#
Set the semi-major (a) and semi-minor radii (b) of the annulus.
- Parameters:
- rfloat or (float, float)
The radius, or semi-axes:
If float: radius of the outer circle.
If two floats: semi-major and -minor axes of outer ellipse.
- set_width(width)[source]#
Set the width (thickness) of the annulus ring.
The width is measured inwards from the outer ellipse.
- Parameters:
- widthfloat
- property width#
Return the width (thickness) of the annulus ring.