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

fill

bool

gid

str

hatch

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

hatch_linewidth

unknown

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>, hatch_linewidth=<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

float 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 or SubFigure

fill

bool

gid

str

hatch

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

hatch_linewidth

unknown

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#

Image

Simple Anchored Artists

Simple Anchored Artists
Image

Looking glass

Looking glass
Image

Clipping images with patches

Clipping images with patches
Image

Anchored Artists

Anchored Artists
Image

Custom projection

Custom projection
Image

Packed-bubble chart

Packed-bubble chart
Image

Draw flat objects in 3D plot

Draw flat objects in 3D plot
Image

Reference for Matplotlib artists

Reference for Matplotlib artists
Image

Dolphins

Dolphins
Image

Mmh Donuts!!!

Mmh Donuts!!!
Image

Circles, Wedges and Polygons

Circles, Wedges and Polygons
Image

Anatomy of a figure

Anatomy of a figure
Image

Radar chart (aka spider or star chart)

Radar chart (aka spider or star chart)
Image

ggplot style sheet

ggplot style sheet
Image

Grayscale style sheet

Grayscale style sheet
Image

Petroff10 style sheet

Petroff10 style sheet
Image

Style sheets reference

Style sheets reference
Image

Axes box aspect

Axes box aspect
Image

AnnotationBbox demo

AnnotationBbox demo
Image

Transformations Tutorial

Transformations Tutorial
Image

Legend guide

Legend guide
Image

Annotations

Annotations