matplotlib.patches.Annulus#

classmatplotlib.patches.Annulus(xy,r,width,angle=0.0,**kwargs)[source]#

Bases:Patch

An 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 inwardfrom the outer ellipse so that for the inner ellipse the semi-axesare given byr-width.width must be less than or equal tothe semi-minor axis.

anglefloat, default: 0

Rotation angle in degrees (anti-clockwise from the positivex-axis). Ignored for circular annuli (i.e., ifr is a scalar).

**kwargs

Keyword arguments control thePatch properties:

Property

Description

agg_filter

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

alpha

unknown

animated

bool

antialiased oraa

bool or None

capstyle

CapStyle or {'butt', 'projecting', 'round'}

clip_box

BboxBase or None

clip_on

bool

clip_path

Patch or (Path, Transform) or None

color

color

edgecolor orec

color or None

facecolor orfc

color or None

figure

Figure orSubFigure

fill

bool

gid

str

hatch

{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}

hatch_linewidth

unknown

in_layout

bool

joinstyle

JoinStyle or {'miter', 'round', 'bevel'}

label

object

linestyle orls

{'-', '--', '-.', ':', '', (offset, on-off-seq), ...}

linewidth orlw

float or None

mouseover

bool

path_effects

list ofAbstractPathEffect

picker

None or bool or float or callable

rasterized

bool

sketch_params

(scale: float, length: float, randomness: float)

snap

bool or None

transform

Transform

url

str

visible

bool

zorder

float

propertyangle#

Return the angle of the annulus.

propertycenter#

Return the center of the annulus.

get_angle()[source]#

Return the angle of the annulus.

get_center()[source]#

Return the center of the annulus.

get_path()[source]#

Return the path of this patch.

get_radii()[source]#

Return the semi-major and semi-minor radii of the annulus.

get_width()[source]#

Return the width (thickness) of the annulus ring.

propertyradii#

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>,facecolor=<UNSET>,fill=<UNSET>,gid=<UNSET>,hatch=<UNSET>,hatch_linewidth=<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.

Supported properties are

Property

Description

agg_filter

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

alpha

float or None

angle

float

animated

bool

antialiased oraa

bool or None

capstyle

CapStyle or {'butt', 'projecting', 'round'}

center

(float, float)

clip_box

BboxBase or None

clip_on

bool

clip_path

Patch or (Path, Transform) or None

color

color

edgecolor orec

color or None

facecolor orfc

color or None

figure

Figure orSubFigure

fill

bool

gid

str

hatch

{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}

hatch_linewidth

unknown

in_layout

bool

joinstyle

JoinStyle or {'miter', 'round', 'bevel'}

label

object

linestyle orls

{'-', '--', '-.', ':', '', (offset, on-off-seq), ...}

linewidth orlw

float or None

mouseover

bool

path_effects

list ofAbstractPathEffect

picker

None or bool or float or callable

radii

float or (float, float)

rasterized

bool

semimajor

float

semiminor

float

sketch_params

(scale: float, length: float, randomness: float)

snap

bool or None

transform

Transform

url

str

visible

bool

width

float

zorder

float

set_angle(angle)[source]#

Set the tilt angle of the annulus.

Parameters:
anglefloat
set_center(xy)[source]#

Set the center of the annulus.

Parameters:
xy(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_semimajor(a)[source]#

Set the semi-major axisa of the annulus.

Parameters:
afloat
set_semiminor(b)[source]#

Set the semi-minor axisb of the annulus.

Parameters:
bfloat
set_width(width)[source]#

Set the width (thickness) of the annulus ring.

The width is measured inwards from the outer ellipse.

Parameters:
widthfloat
propertywidth#

Return the width (thickness) of the annulus ring.