matplotlib.patches.Circle#

class matplotlib.patches.Circle(xy, radius=5, **kwargs)[source]#

Bases: Ellipse

A circle patch.

Create a true circle at center xy = (x, y) with given radius.

Unlike CirclePolygon which is a polygonal approximation, this uses Bezier splines and is much closer to a scale-free circle.

Valid keyword arguments 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

unknown

animated

bool

antialiased or aa

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 or ec

color or None

facecolor or fc

color or None

figure

Figure

fill

bool

gid

str

hatch

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

in_layout

bool

joinstyle

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

label

object

linestyle or ls

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

linewidth or lw

float or None

mouseover

bool

path_effects

list of AbstractPathEffect

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

get_radius()[source]#

Return the radius of the circle.

property radius#

Return the radius of the circle.

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>, height=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, mouseover=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, radius=<UNSET>, rasterized=<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

scalar or None

angle

float

animated

bool

antialiased or aa

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 or ec

color or None

facecolor or fc

color or None

figure

Figure

fill

bool

gid

str

hatch

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

height

float

in_layout

bool

joinstyle

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

label

object

linestyle or ls

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

linewidth or lw

float or None

mouseover

bool

path_effects

list of AbstractPathEffect

picker

None or bool or float or callable

radius

float

rasterized

bool

sketch_params

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

snap

bool or None

transform

Transform

url

str

visible

bool

width

float

zorder

float

set_radius(radius)[source]#

Set the radius of the circle.

Parameters:
radiusfloat

Examples using matplotlib.patches.Circle#

Clipping images with patches

Clipping images with patches

Axes box aspect

Axes box aspect

AnnotationBbox demo

AnnotationBbox demo

Reference for Matplotlib artists

Reference for Matplotlib artists

Dolphins

Dolphins

Mmh Donuts!!!

Mmh Donuts!!!

Circles, Wedges and Polygons

Circles, Wedges and Polygons

ggplot style sheet

ggplot style sheet

Grayscale style sheet

Grayscale style sheet

Style sheets reference

Style sheets reference

Simple Anchored Artists

Simple Anchored Artists

Anatomy of a figure

Anatomy of a figure

Looking Glass

Looking Glass

Anchored Artists

Anchored Artists

Custom projection

Custom projection

Packed-bubble chart

Packed-bubble chart

Draw flat objects in 3D plot

Draw flat objects in 3D plot

Radar chart (aka spider or star chart)

Radar chart (aka spider or star chart)

Transformations Tutorial

Transformations Tutorial

Legend guide

Legend guide

Annotations

Annotations