Bases: matplotlib.patches._Style
BoxStyle is a container class which defines several boxstyle classes, which are used for FancyBboxPatch.
A style object can be created as:
or:
or:
The following boxstyle classes are defined.
Class
Name
Attrs
Square
square
pad=0.3
Circle
circle
pad=0.3
LArrow
larrow
pad=0.3
RArrow
rarrow
pad=0.3
DArrow
darrow
pad=0.3
Round
round
pad=0.3, rounding_size=None
Round4
round4
pad=0.3, rounding_size=None
Sawtooth
sawtooth
pad=0.3, tooth_size=None
Roundtooth
roundtooth
pad=0.3, tooth_size=None
An instance of any boxstyle class is an callable object, whose call signature is:
and returns a Path instance. x0, y0, width and height specify the location and size of the box to be drawn. mutation_scale determines the overall size of the mutation (by which I mean the transformation of the rectangle to the fancy box).
Return the instance of the subclass with the given style name.
Bases: matplotlib.patches.BoxStyle._Base
A circular box.
The amount of padding around the original box.
Given the location and size of the box, return the path of the box around it.
Location and size of the box.
A reference scale for the mutation.
Bases: matplotlib.patches.BoxStyle._Base
A box in the shape of a two-way arrow.
The amount of padding around the original box.
Given the location and size of the box, return the path of the box around it.
Location and size of the box.
A reference scale for the mutation.
Bases: matplotlib.patches.BoxStyle._Base
A box in the shape of a left-pointing arrow.
The amount of padding around the original box.
Given the location and size of the box, return the path of the box around it.
Location and size of the box.
A reference scale for the mutation.
Bases: matplotlib.patches.BoxStyle.LArrow
A box in the shape of a right-pointing arrow.
The amount of padding around the original box.
Given the location and size of the box, return the path of the box around it.
Location and size of the box.
A reference scale for the mutation.
Bases: matplotlib.patches.BoxStyle._Base
A box with round corners.
The amount of padding around the original box.
Radius of the corners.
Given the location and size of the box, return the path of the box around it.
Location and size of the box.
A reference scale for the mutation.
Bases: matplotlib.patches.BoxStyle._Base
A box with rounded edges.
The amount of padding around the original box.
Rounding of edges.
Given the location and size of the box, return the path of the box around it.
Location and size of the box.
A reference scale for the mutation.
Bases: matplotlib.patches.BoxStyle.Sawtooth
A box with a rounded sawtooth outline.
The amount of padding around the original box.
Size of the sawtooth.
Given the location and size of the box, return the path of the box around it.
Location and size of the box.
A reference scale for the mutation.
Bases: matplotlib.patches.BoxStyle._Base
A box with a sawtooth outline.
The amount of padding around the original box.
Size of the sawtooth.
Given the location and size of the box, return the path of the box around it.
Location and size of the box.
A reference scale for the mutation.
Bases: matplotlib.patches.BoxStyle._Base
A square box.
The amount of padding around the original box.
Given the location and size of the box, return the path of the box around it.
Location and size of the box.
A reference scale for the mutation.
Reference for Matplotlib artists


Bases: matplotlib.patches.BoxStyle._Base
A circular box.
The amount of padding around the original box.
Given the location and size of the box, return the path of the box around it.
Location and size of the box.
A reference scale for the mutation.


Given the location and size of the box, return the path of the box around it.
Location and size of the box.
A reference scale for the mutation.


Bases: matplotlib.patches.BoxStyle._Base
A box in the shape of a two-way arrow.
The amount of padding around the original box.
Given the location and size of the box, return the path of the box around it.
Location and size of the box.
A reference scale for the mutation.


Bases: matplotlib.patches.BoxStyle._Base
A box in the shape of a left-pointing arrow.
The amount of padding around the original box.
Given the location and size of the box, return the path of the box around it.
Location and size of the box.
A reference scale for the mutation.


Bases: matplotlib.patches.BoxStyle.LArrow
A box in the shape of a right-pointing arrow.
The amount of padding around the original box.
Given the location and size of the box, return the path of the box around it.
Location and size of the box.
A reference scale for the mutation.


Bases: matplotlib.patches.BoxStyle._Base
A box with round corners.
The amount of padding around the original box.
Radius of the corners.
Given the location and size of the box, return the path of the box around it.
Location and size of the box.
A reference scale for the mutation.


Bases: matplotlib.patches.BoxStyle._Base
A box with rounded edges.
The amount of padding around the original box.
Rounding of edges.
Given the location and size of the box, return the path of the box around it.
Location and size of the box.
A reference scale for the mutation.


Bases: matplotlib.patches.BoxStyle.Sawtooth
A box with a rounded sawtooth outline.
The amount of padding around the original box.
Size of the sawtooth.
Given the location and size of the box, return the path of the box around it.
Location and size of the box.
A reference scale for the mutation.


Bases: matplotlib.patches.BoxStyle._Base
A box with a sawtooth outline.
The amount of padding around the original box.
Size of the sawtooth.
Given the location and size of the box, return the path of the box around it.
Location and size of the box.
A reference scale for the mutation.


Bases: matplotlib.patches.BoxStyle._Base
A square box.
The amount of padding around the original box.
Given the location and size of the box, return the path of the box around it.
Location and size of the box.
A reference scale for the mutation.


Bases: matplotlib.patches.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
alpha
unknown
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
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
path_effects
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
Return the radius of the circle.
Return the radius of the circle.
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
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
Bbox
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
path_effects
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 the radius of the circle.
Clipping images with patches
Axes box aspect
AnnotationBbox demo
Reference for Matplotlib artists
Dolphins
Circles, Wedges and Polygons
ggplot style sheet
Grayscale style sheet
Style sheets reference
Simple Anchored Artists
Anatomy of a figure
Looking Glass
Anchored Artists
Custom projection
Packed-bubble chart
Draw flat objects in 3D plot
Radar chart (aka spider or star chart)
Artist tutorial
Legend guide
Transformations Tutorial
Annotations


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
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
Bbox
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
path_effects
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


Bases: matplotlib.patches.RegularPolygon
A polygon-approximation of a circle patch.
Create a circle at xy = (x, y) with given radius.
This circle is approximated by a regular polygon with resolution sides. For a smoother circle drawn with splines, see 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
alpha
unknown
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
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
path_effects
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
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
alpha
scalar or None
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
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
path_effects
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


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
alpha
scalar or None
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
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
path_effects
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


Bases: matplotlib.patches.FancyArrowPatch
A patch that connects two points (possibly in different axes).
Connect point xyA in coordsA with point xyB in coordsB.
Valid keys are
Key
Description
arrowstyle
the arrow style
connectionstyle
the connection style
relpos
default is (0.5, 0.5)
patchA
default is bounding box of the text
patchB
default is None
shrinkA
default is 2 points
shrinkB
default is 2 points
mutation_scale
default is text size (in points)
mutation_aspect
default is 1.
?
any key for matplotlib.patches.PathPatch
coordsA and coordsB are strings that indicate the coordinates of xyA and xyB.
Property
Description
'figure points'
points from the lower left corner of the figure
'figure pixels'
pixels from the lower left corner of the figure
'figure fraction'
0, 0 is lower left of figure and 1, 1 is upper right
'subfigure points'
points from the lower left corner of the subfigure
'subfigure pixels'
pixels from the lower left corner of the subfigure
'subfigure fraction'
fraction of the subfigure, 0, 0 is lower left.
'axes points'
points from lower left corner of axes
'axes pixels'
pixels from lower left corner of axes
'axes fraction'
0, 0 is lower left of axes and 1, 1 is upper right
'data'
use the coordinate system of the object being annotated (default)
'offset points'
offset (in points) from the xy value
'polar'
you can specify theta, r for the annotation, even in cartesian plots. Note that if you are using a polar axes, you do not need to specify polar for the coordinate system since that is the native "data" coordinate system.
Alternatively they can be set to any valid Transform.
Note that 'subfigure pixels' and 'figure pixels' are the same for the parent figure, so users who want code that is usable in a subfigure can use 'subfigure pixels'.
Note
Using ConnectionPatch across two Axes instances is not directly compatible with constrained layout. Add the artist directly to the Figure instead of adding it to a specific Axes, or exclude it from the layout using con.set_in_layout(False).
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible (Artist.get_visible returns False).
This method is overridden in the Artist subclasses.
Return the clipping behavior.
See set_annotation_clip for the meaning of the return value.
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
alpha
scalar or None
animated
bool
annotation_clip
bool or None
antialiased or aa
bool or None
arrowstyle
None or ArrowStyle or str, default: None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
color
color
connectionstyle
str or ConnectionStyle or None, optional
dpi_cor
unknown
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
mutation_aspect
float
mutation_scale
float
patchA
patches.Patch
patchB
patches.Patch
path_effects
AbstractPathEffect
picker
None or bool or float or callable
positions
unknown
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
transform
Transform
url
str
visible
bool
zorder
float
Set the clipping behavior.
Bar of pie
Connect Simple01
Constrained Layout Guide


Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible (Artist.get_visible returns False).
This method is overridden in the Artist subclasses.


Return the clipping behavior.
See set_annotation_clip for the meaning of the return value.


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
alpha
scalar or None
animated
bool
annotation_clip
bool or None
antialiased or aa
bool or None
arrowstyle
None or ArrowStyle or str, default: None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
color
color
connectionstyle
str or ConnectionStyle or None, optional
dpi_cor
unknown
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
mutation_aspect
float
mutation_scale
float
patchA
patches.Patch
patchB
patches.Patch
path_effects
AbstractPathEffect
picker
None or bool or float or callable
positions
unknown
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
transform
Transform
url
str
visible
bool
zorder
float


Bases: matplotlib.patches._Style
ConnectionStyle is a container class which defines several connectionstyle classes, which is used to create a path between two points. These are mainly used with FancyArrowPatch.
A connectionstyle object can be either created as:
or:
or:
The following classes are defined
Class
Name
Attrs
Arc3
arc3
rad=0.0
Angle3
angle3
angleA=90, angleB=0
Angle
angle
angleA=90, angleB=0, rad=0.0
Arc
arc
angleA=0, angleB=0, armA=None, armB=None, rad=0.0
Bar
bar
armA=0.0, armB=0.0, fraction=0.3, angle=None
An instance of any connection style class is an callable object, whose call signature is:
and it returns a Path instance. posA and posB are tuples of (x, y) coordinates of the two points to be connected. patchA (or patchB) is given, the returned path is clipped so that it start (or end) from the boundary of the patch. The path is further shrunk by shrinkA (or shrinkB) which is given in points.
Return the instance of the subclass with the given style name.
Bases: matplotlib.patches.ConnectionStyle._Base
Creates a piecewise continuous quadratic Bezier path between two points. The path has a one passing-through point placed at the intersecting point of two lines which cross the start and end point, and have a slope of angleA and angleB, respectively. The connecting edges are rounded with rad.
starting angle of the path
ending angle of the path
rounding radius of the edge
Bases: matplotlib.patches.ConnectionStyle._Base
Creates a simple quadratic Bezier curve between two points. The middle control points is placed at the intersecting point of two lines which cross the start and end point, and have a slope of angleA and angleB, respectively.
starting angle of the path
ending angle of the path
Bases: matplotlib.patches.ConnectionStyle._Base
Creates a piecewise continuous quadratic Bezier path between two points. The path can have two passing-through points, a point placed at the distance of armA and angle of angleA from point A, another point with respect to point B. The edges are rounded with rad.
starting angle of the path
ending angle of the path
length of the starting arm
length of the ending arm
rounding radius of the edges
Bases: matplotlib.patches.ConnectionStyle._Base
Creates a simple quadratic Bezier curve between two points. The curve is created so that the middle control point (C1) is located at the same distance from the start (C0) and end points(C2) and the distance of the C1 to the line connecting C0-C2 is rad times the distance of C0-C2.
curvature of the curve.
Bases: matplotlib.patches.ConnectionStyle._Base
A line with angle between A and B with armA and armB. One of the arms is extended so that they are connected in a right angle. The length of armA is determined by (armA + fraction x AB distance). Same for armB.
minimum length of armA
minimum length of armB
a fraction of the distance between two points that will be added to armA and armB.
angle of the connecting line (if None, parallel to A and B)


Bases: matplotlib.patches.ConnectionStyle._Base
Creates a piecewise continuous quadratic Bezier path between two points. The path has a one passing-through point placed at the intersecting point of two lines which cross the start and end point, and have a slope of angleA and angleB, respectively. The connecting edges are rounded with rad.
starting angle of the path
ending angle of the path
rounding radius of the edge


Bases: matplotlib.patches.ConnectionStyle._Base
Creates a simple quadratic Bezier curve between two points. The middle control points is placed at the intersecting point of two lines which cross the start and end point, and have a slope of angleA and angleB, respectively.
starting angle of the path
ending angle of the path


Bases: matplotlib.patches.ConnectionStyle._Base
Creates a piecewise continuous quadratic Bezier path between two points. The path can have two passing-through points, a point placed at the distance of armA and angle of angleA from point A, another point with respect to point B. The edges are rounded with rad.
starting angle of the path
ending angle of the path
length of the starting arm
length of the ending arm
rounding radius of the edges


Bases: matplotlib.patches.ConnectionStyle._Base
Creates a simple quadratic Bezier curve between two points. The curve is created so that the middle control point (C1) is located at the same distance from the start (C0) and end points(C2) and the distance of the C1 to the line connecting C0-C2 is rad times the distance of C0-C2.
curvature of the curve.


Bases: matplotlib.patches.ConnectionStyle._Base
A line with angle between A and B with armA and armB. One of the arms is extended so that they are connected in a right angle. The length of armA is determined by (armA + fraction x AB distance). Same for armB.
minimum length of armA
minimum length of armB
a fraction of the distance between two points that will be added to armA and armB.
angle of the connecting line (if None, parallel to A and B)


A debug function to draw a rectangle around the bounding box returned by an artist's Artist.get_window_extent to test whether the artist is returning the correct bbox.


Bases: matplotlib.patches.Patch
A scale-free ellipse.
xy coordinates of ellipse centre.
Total length (diameter) of horizontal axis.
Total length (diameter) of vertical axis.
Rotation in degrees anti-clockwise.
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
alpha
unknown
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
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
path_effects
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
Return the angle of the ellipse.
Return the center of the ellipse.
Return the angle of the ellipse.
Return the center of the ellipse.
Return the height of the ellipse.
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.
Return the path of the ellipse.
Return the width of the ellipse.
Return the height of the ellipse.
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
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
Bbox
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
path_effects
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
width
float
zorder
float
Set the angle of the ellipse.
Set the center of the ellipse.
Set the height of the ellipse.
Set the width of the ellipse.
Return the width of the ellipse.
Clipping images with patches
Axes box aspect
Plot a confidence ellipse of a two-dimensional dataset
Scale invariant angle label
Annotating Plots
AnnotationBbox demo
Reference for Matplotlib artists
Dolphins
Ellipse Demo
Hatch demo
Circles, Wedges and Polygons
ggplot style sheet
Grayscale style sheet
Style sheets reference
Anatomy of a figure
Looking Glass
Anchored Artists
Custom projection
Packed-bubble chart
Draw flat objects in 3D plot
Radar chart (aka spider or star chart)
Ellipse With Units
Anchored Box04
Annotate Explain
Simple Annotate01
Legend guide
Transformations Tutorial
Annotations


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.


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
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
Bbox
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
path_effects
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
width
float
zorder
float


Bases: matplotlib.patches.Polygon
Like Arrow, but lets you set head width and head height independently.
The x and y coordinates of the arrow base.
The length of the arrow along x and y direction.
Width of full arrow tail.
True if head is to be counted in calculating the length.
Total width of the full arrow head.
Length of arrow head.
Draw the left-half, right-half, or full arrow.
Fraction that the arrow is swept back (0 overhang means triangular shape). Can be negative or greater than one.
If True, the head starts being drawn at coordinate 0 instead of ending at coordinate 0.
Patch 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
alpha
unknown
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
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
path_effects
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
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
alpha
scalar or None
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
closed
bool
color
color
data
unknown
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
path_effects
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
xy
(N, 2) array-like
zorder
float
Set FancyArrow x, y, dx, dy, width, head_with, and head_length. Values left as None will not be updated.
The x and y coordinates of the arrow base.
The length of the arrow along x and y direction.
Width of full arrow tail.
Total width of the full arrow head.
Length of arrow head.
Arrow guide


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
alpha
scalar or None
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
closed
bool
color
color
data
unknown
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
path_effects
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
xy
(N, 2) array-like
zorder
float


Set FancyArrow x, y, dx, dy, width, head_with, and head_length. Values left as None will not be updated.
The x and y coordinates of the arrow base.
The length of the arrow along x and y direction.
Width of full arrow tail.
Total width of the full arrow head.
Length of arrow head.


Bases: matplotlib.patches.Patch
A fancy arrow patch. It draws an arrow using the ArrowStyle.
The head and tail positions are fixed at the specified start and end points of the arrow, but the size and shape (in display coordinates) of the arrow does not change when the axis is moved or zoomed.
There are two ways for defining an arrow:
(x, y) coordinates of arrow tail and arrow head respectively.
If provided, an arrow is drawn along this path and patchA, patchB, shrinkA, and shrinkB are ignored.
The ArrowStyle with which the fancy arrow is drawn. If a string, it should be one of the available arrowstyle names, with optional comma-separated attributes. The optional attributes are meant to be scaled with the mutation_scale. The following arrow styles are available:
Class
Name
Attrs
Curve
-
None
CurveA
<-
head_length=0.4, head_width=0.2, widthA=1.0, widthB=1.0, lengthA=0.2, lengthB=0.2, angleA=0, angleB=0, scaleA=None, scaleB=None
CurveB
->
head_length=0.4, head_width=0.2, widthA=1.0, widthB=1.0, lengthA=0.2, lengthB=0.2, angleA=0, angleB=0, scaleA=None, scaleB=None
CurveAB
<->
head_length=0.4, head_width=0.2, widthA=1.0, widthB=1.0, lengthA=0.2, lengthB=0.2, angleA=0, angleB=0, scaleA=None, scaleB=None
CurveFilledA
<|-
head_length=0.4, head_width=0.2, widthA=1.0, widthB=1.0, lengthA=0.2, lengthB=0.2, angleA=0, angleB=0, scaleA=None, scaleB=None
CurveFilledB
-|>
head_length=0.4, head_width=0.2, widthA=1.0, widthB=1.0, lengthA=0.2, lengthB=0.2, angleA=0, angleB=0, scaleA=None, scaleB=None
CurveFilledAB
<|-|>
head_length=0.4, head_width=0.2, widthA=1.0, widthB=1.0, lengthA=0.2, lengthB=0.2, angleA=0, angleB=0, scaleA=None, scaleB=None
BracketA
]-
widthA=1.0, lengthA=0.2, angleA=0
BracketB
-[
widthB=1.0, lengthB=0.2, angleB=0
BracketAB
]-[
widthA=1.0, lengthA=0.2, angleA=0, widthB=1.0, lengthB=0.2, angleB=0
BarAB
|-|
widthA=1.0, angleA=0, widthB=1.0, angleB=0
BracketCurve
]->
widthA=1.0, lengthA=0.2, angleA=None
CurveBracket
<-[
widthB=1.0, lengthB=0.2, angleB=None
Simple
simple
head_length=0.5, head_width=0.5, tail_width=0.2
Fancy
fancy
head_length=0.4, head_width=0.4, tail_width=0.4
Wedge
wedge
tail_width=0.3, shrink_factor=0.5
The ConnectionStyle with which posA and posB are connected. If a string, it should be one of the available connectionstyle names, with optional comma-separated attributes. The following connection styles are available:
Class
Name
Attrs
Arc3
arc3
rad=0.0
Angle3
angle3
angleA=90, angleB=0
Angle
angle
angleA=90, angleB=0, rad=0.0
Arc
arc
angleA=0, angleB=0, armA=None, armB=None, rad=0.0
Bar
bar
armA=0.0, armB=0.0, fraction=0.3, angle=None
Head and tail patches, respectively.
Shrinking factor of the tail and head of the arrow respectively.
Value with which attributes of arrowstyle (e.g., head_length) will be scaled.
The height of the rectangle will be squeezed by this value before the mutation and the mutated box will be stretched by the inverse of it.
dpi_cor is currently used for linewidth-related things and shrink factor. Mutation scale is affected by this. Deprecated.
Here is a list of available Patch 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
alpha
unknown
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
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
path_effects
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
In contrast to other patches, the default capstyle and joinstyle for FancyArrowPatch are set to "round".
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible (Artist.get_visible returns False).
This method is overridden in the Artist subclasses.
Return the arrowstyle object.
Return the ConnectionStyle used.
[Deprecated] dpi_cor is currently used for linewidth-related things and shrink factor. Mutation scale is affected by this.
Deprecated since version 3.4.
Return the aspect ratio of the bbox mutation.
Return the mutation scale.
Return the path of the arrow in the data coordinates.
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
alpha
scalar or None
animated
bool
antialiased or aa
bool or None
arrowstyle
None or ArrowStyle or str, default: None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
color
color
connectionstyle
str or ConnectionStyle or None, optional
dpi_cor
unknown
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
mutation_aspect
float
mutation_scale
float
patchA
patches.Patch
patchB
patches.Patch
path_effects
AbstractPathEffect
picker
None or bool or float or callable
positions
unknown
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
transform
Transform
url
str
visible
bool
zorder
float
Set the arrow style. Old attributes are forgotten. Without arguments (or with arrowstyle=None) returns available box styles as a list of strings.
Can be a string with arrowstyle name with optional comma-separated attributes, e.g.:
Alternatively attributes can be provided as keywords, e.g.:
Set the connection style. Old attributes are forgotten.
Can be a string with connectionstyle name with optional comma-separated attributes, e.g.:
Alternatively, the attributes can be provided as keywords, e.g.:
Without any arguments (or with connectionstyle=None), return available styles as a list of strings.
[Deprecated] dpi_cor is currently used for linewidth-related things and shrink factor. Mutation scale is affected by this.
Deprecated since version 3.4.
Set the aspect ratio of the bbox mutation.
Set the mutation scale.
Set the tail patch.
Set the head patch.
Set the begin and end positions of the connecting path.
(x, y) coordinates of arrow tail and arrow head respectively. If None use current value.
Bar of pie
Arrow guide
Connect Simple01


Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible (Artist.get_visible returns False).
This method is overridden in the Artist subclasses.


[Deprecated] dpi_cor is currently used for linewidth-related things and shrink factor. Mutation scale is affected by this.
Deprecated since version 3.4.


Return the aspect ratio of the bbox mutation.


Return the path of the arrow in the data coordinates.


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
alpha
scalar or None
animated
bool
antialiased or aa
bool or None
arrowstyle
None or ArrowStyle or str, default: None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
color
color
connectionstyle
str or ConnectionStyle or None, optional
dpi_cor
unknown
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
mutation_aspect
float
mutation_scale
float
patchA
patches.Patch
patchB
patches.Patch
path_effects
AbstractPathEffect
picker
None or bool or float or callable
positions
unknown
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
transform
Transform
url
str
visible
bool
zorder
float


Set the arrow style. Old attributes are forgotten. Without arguments (or with arrowstyle=None) returns available box styles as a list of strings.
Can be a string with arrowstyle name with optional comma-separated attributes, e.g.:
Alternatively attributes can be provided as keywords, e.g.:


Set the connection style. Old attributes are forgotten.
Can be a string with connectionstyle name with optional comma-separated attributes, e.g.:
Alternatively, the attributes can be provided as keywords, e.g.:
Without any arguments (or with connectionstyle=None), return available styles as a list of strings.


Set the aspect ratio of the bbox mutation.


Set the begin and end positions of the connecting path.
(x, y) coordinates of arrow tail and arrow head respectively. If None use current value.


Bases: matplotlib.patches.Patch
A fancy box around a rectangle with lower left at xy = (x, y) with specified width and height.
FancyBboxPatch is similar to Rectangle, but it draws a fancy box around the rectangle. The transformation of the rectangle box to the fancy box is delegated to the style classes defined in BoxStyle.
The lower left corner of the box.
The width of the box.
The height of the box.
The style of the fancy box. This can either be a BoxStyle instance or a string of the style name and optionally comma seprarated attributes (e.g. "Round, pad=0.2"). This string is passed to BoxStyle to construct a BoxStyle object. See there for a full documentation.
The following box styles are available:
Class
Name
Attrs
Square
square
pad=0.3
Circle
circle
pad=0.3
LArrow
larrow
pad=0.3
RArrow
rarrow
pad=0.3
DArrow
darrow
pad=0.3
Round
round
pad=0.3, rounding_size=None
Round4
round4
pad=0.3, rounding_size=None
Sawtooth
sawtooth
pad=0.3, tooth_size=None
Roundtooth
roundtooth
pad=0.3, tooth_size=None
Scaling factor applied to the attributes of the box style (e.g. pad or rounding_size).
The height of the rectangle will be squeezed by this value before the mutation and the mutated box will be stretched by the inverse of it. For example, this allows different horizontal and vertical padding.
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
alpha
unknown
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
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
path_effects
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
Return the Bbox.
Return the boxstyle object.
Return the height of the rectangle.
Return the aspect ratio of the bbox mutation.
Return the mutation scale.
Return the mutated path of the rectangle.
Return the width of the rectangle.
Return the left coord of the rectangle.
Return the bottom coord of the rectangle.
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
alpha
scalar or None
animated
bool
antialiased or aa
bool or None
bounds
unknown
boxstyle
[ 'square' | 'circle' | 'larrow' | 'rarrow' | 'darrow' | 'round' | 'round4' | 'sawtooth' | 'roundtooth' ]
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
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
mutation_aspect
float
mutation_scale
float
path_effects
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
width
float
x
float
y
float
zorder
float
Set the bounds of the rectangle.
Call signatures:
The coordinates of the bottom left corner of the rectangle.
The width/height of the rectangle.
Set the box style.
Most box styles can be further configured using attributes. Attributes from the previous box style are not reused.
Without argument (or with boxstyle=None), the available box styles are returned as a human-readable string.
The style of the fancy box. This can either be a BoxStyle instance or a string of the style name and optionally comma seprarated attributes (e.g. "Round, pad=0.2"). This string is passed to BoxStyle to construct a BoxStyle object. See there for a full documentation.
The following box styles are available:
Class
Name
Attrs
Square
square
pad=0.3
Circle
circle
pad=0.3
LArrow
larrow
pad=0.3
RArrow
rarrow
pad=0.3
DArrow
darrow
pad=0.3
Round
round
pad=0.3, rounding_size=None
Round4
round4
pad=0.3, rounding_size=None
Sawtooth
sawtooth
pad=0.3, tooth_size=None
Roundtooth
roundtooth
pad=0.3, tooth_size=None
Additional attributes for the box style. See the table above for supported parameters.
Set the rectangle height.
Set the aspect ratio of the bbox mutation.
Set the mutation scale.
Set the rectangle width.
Set the left coord of the rectangle.
Set the bottom coord of the rectangle.
Reference for Matplotlib artists
Drawing fancy boxes
Annotate Text Arrow


Return the mutated path of the rectangle.


Return the bottom coord of the rectangle.


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
alpha
scalar or None
animated
bool
antialiased or aa
bool or None
bounds
unknown
boxstyle
[ 'square' | 'circle' | 'larrow' | 'rarrow' | 'darrow' | 'round' | 'round4' | 'sawtooth' | 'roundtooth' ]
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
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
mutation_aspect
float
mutation_scale
float
path_effects
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
width
float
x
float
y
float
zorder
float


Set the bounds of the rectangle.
Call signatures:
The coordinates of the bottom left corner of the rectangle.
The width/height of the rectangle.


Set the box style.
Most box styles can be further configured using attributes. Attributes from the previous box style are not reused.
Without argument (or with boxstyle=None), the available box styles are returned as a human-readable string.
The style of the fancy box. This can either be a BoxStyle instance or a string of the style name and optionally comma seprarated attributes (e.g. "Round, pad=0.2"). This string is passed to BoxStyle to construct a BoxStyle object. See there for a full documentation.
The following box styles are available:
Class
Name
Attrs
Square
square
pad=0.3
Circle
circle
pad=0.3
LArrow
larrow
pad=0.3
RArrow
rarrow
pad=0.3
DArrow
darrow
pad=0.3
Round
round
pad=0.3, rounding_size=None
Round4
round4
pad=0.3, rounding_size=None
Sawtooth
sawtooth
pad=0.3, tooth_size=None
Roundtooth
roundtooth
pad=0.3, tooth_size=None
Additional attributes for the box style. See the table above for supported parameters.


Bases: matplotlib.artist.Artist
A patch is a 2D artist with a face color and an edge color.
If any of edgecolor, facecolor, linewidth, or antialiased are None, they default to their rc params setting.
The following kwarg properties are supported
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
alpha
unknown
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
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
path_effects
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
Test whether the mouse event occurred in the patch.
Return whether the given point is inside the patch.
The point (x, y) to check, in target coordinates of self.get_transform(). These are display coordinates for patches that are added to a figure or axes.
Add an additional margin on the patch in target coordinates of self.get_transform(). See Path.contains_point for further details.
The proper use of this method depends on the transform of the patch. Isolated patches do not have a transform. In this case, the patch creation coordinates and the point coordinates match. The following example checks that the center of a circle is within the circle
The convention of checking against the transformed patch stems from the fact that this method is predominantly used to check if display coordinates (e.g. from mouse events) are within the patch. If you want to do the above check with data coordinates, you have to properly transform them first:
Return whether the given points are inside the patch.
The points to check, in target coordinates of self.get_transform(). These are display coordinates for patches that are added to a figure or axes. Columns contain x and y values.
Add an additional margin on the patch in target coordinates of self.get_transform(). See Path.contains_point for further details.
The proper use of this method depends on the transform of the patch. See the notes on Patch.contains_point.
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible (Artist.get_visible returns False).
This method is overridden in the Artist subclasses.
Return whether the patch is filled.
Alias for get_antialiased.
Return whether antialiasing is used for drawing.
Return the capstyle.
Return the Transform mapping data coordinates to physical coordinates.
Alias for get_edgecolor.
Return the edge color.
Return the Patch's axis-aligned extents as a Bbox.
Return the face color.
Alias for get_facecolor.
Return whether the patch is filled.
Return the hatching pattern.
Return the joinstyle.
Return the linestyle.
Return the line width in points.
Alias for get_linestyle.
Alias for get_linewidth.
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.
Return the path of this patch.
Return the Transform applied to the Patch.
Return a copy of the vertices used in this patch.
If the patch contains Bezier curves, the curves will be interpolated by line segments. To access the curves as curves, use get_path.
Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.
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
alpha
unknown
animated
bool
antialiased
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
color
color
edgecolor
color or None
facecolor
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
{'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth
float or None
path_effects
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
Alias for set_antialiased.
Set the alpha value used for blending - not supported on all backends.
alpha must be within the 0-1 range, inclusive.
Set whether to use antialiased rendering.
Set the CapStyle.
Set both the edgecolor and the facecolor.
See also
For setting the edge or face color individually.
Alias for set_edgecolor.
Set the patch edge color.
Set the patch face color.
Alias for set_facecolor.
Set whether to fill the patch.
Set the hatching pattern.
hatch can be one of:
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.
Set the JoinStyle.
Set the patch linestyle.
linestyle
description
'-' or 'solid'
solid line
'--' or 'dashed'
dashed line
'-.' or 'dashdot'
dash-dotted line
':' or 'dotted'
dotted line
'none', 'None', ' ', or ''
draw nothing
Alternatively a dash tuple of the following form can be provided:
where onoffseq is an even length tuple of on and off ink in points.
The line style.
Set the patch linewidth in points.
Alias for set_linestyle.
Alias for set_linewidth.
Copy properties from other to self.
Curve with error band
Stairs Demo
Clipping images with patches
Image Demo
Axes box aspect
Controlling view limits using margins and sticky_edges
Axes Zoom Effect
Boxplots
Plot a confidence ellipse of a two-dimensional dataset
Creating boxes from error bars using PatchCollection
Bar of pie
Scale invariant angle label
Annotating Plots
Composing Custom Legends
AnnotationBbox demo
Using a text as a Path
Text Rotation Mode
Precise text layout
Text Layout
List of named colors
Arrow guide
Reference for Matplotlib artists
Compound path
Dolphins
Mmh Donuts!!!
Ellipse Demo
Drawing fancy boxes
Hatch demo
Hatch style reference
Circles, Wedges and Polygons
PathPatch object
Bezier Curve
ggplot style sheet
Grayscale style sheet
Style sheets reference
Inset Locator Demo
Anatomy of a figure
Firefox
Integral as the area under a curve
Looking Glass
Path Editor
Pick Event Demo
Poly Editor
Trifinder Event Demo
Viewlims
Anchored Artists
Changing colors of lines intersecting a box
Custom projection
Building histograms using Rectangles and PolyCollections
Matplotlib logo
Packed-bubble chart
SVG Filter Pie
TickedStroke patheffect
Draw flat objects in 3D plot
Hinton diagrams
Radar chart (aka spider or star chart)
SkewT-logP diagram: using transforms and custom projections
Artist tests
Ellipse With Units
Anchored Box04
Annotate Explain
Connect Simple01
Simple Annotate01
Menu
Artist tutorial
Legend guide
Path Tutorial
Transformations Tutorial
Specifying Colors
Text properties and layout
Annotations


Test whether the mouse event occurred in the patch.


Return whether the given point is inside the patch.
The point (x, y) to check, in target coordinates of self.get_transform(). These are display coordinates for patches that are added to a figure or axes.
Add an additional margin on the patch in target coordinates of self.get_transform(). See Path.contains_point for further details.
The proper use of this method depends on the transform of the patch. Isolated patches do not have a transform. In this case, the patch creation coordinates and the point coordinates match. The following example checks that the center of a circle is within the circle
The convention of checking against the transformed patch stems from the fact that this method is predominantly used to check if display coordinates (e.g. from mouse events) are within the patch. If you want to do the above check with data coordinates, you have to properly transform them first:


Return whether the given points are inside the patch.
The points to check, in target coordinates of self.get_transform(). These are display coordinates for patches that are added to a figure or axes. Columns contain x and y values.
Add an additional margin on the patch in target coordinates of self.get_transform(). See Path.contains_point for further details.
The proper use of this method depends on the transform of the patch. See the notes on Patch.contains_point.


Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible (Artist.get_visible returns False).
This method is overridden in the Artist subclasses.


Return whether antialiasing is used for drawing.


Return the Transform mapping data coordinates to physical coordinates.


Return the Patch's axis-aligned extents as a Bbox.


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.


Return the Transform applied to the Patch.


Return a copy of the vertices used in this patch.
If the patch contains Bezier curves, the curves will be interpolated by line segments. To access the curves as curves, use get_path.


Get the artist's bounding box in display space.
The bounding box' width and height are nonnegative.
Subclasses should override for inclusion in the bounding box "tight" calculation. Default is to return an empty bounding box at 0, 0.
Be careful when using this function, the results will not update if the artist window extent of the artist changes. The extent can change due to any changes in the transform stack, such as changing the axes limits, the figure size, or the canvas used (as is done when saving a figure). This can lead to unexpected behavior where interactive figures will look fine on the screen, but will save incorrectly.


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
alpha
unknown
animated
bool
antialiased
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
color
color
edgecolor
color or None
facecolor
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
{'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth
float or None
path_effects
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


Set the alpha value used for blending - not supported on all backends.
alpha must be within the 0-1 range, inclusive.


Set whether to use antialiased rendering.


Set both the edgecolor and the facecolor.
See also
For setting the edge or face color individually.


Set the hatching pattern.
hatch can be one of:
Letters can be combined, in which case all the specified hatchings are done. If same letter repeats, it increases the density of hatching of that pattern.
Hatching is supported in the PostScript, PDF, SVG and Agg backends only.


Set the patch linestyle.
linestyle
description
'-' or 'solid'
solid line
'--' or 'dashed'
dashed line
'-.' or 'dashdot'
dash-dotted line
':' or 'dotted'
dotted line
'none', 'None', ' ', or ''
draw nothing
Alternatively a dash tuple of the following form can be provided:
where onoffseq is an even length tuple of on and off ink in points.
The line style.


Bases: matplotlib.patches.Patch
A general polycurve path patch.
path is a Path object.
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
alpha
unknown
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
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
path_effects
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
Return the path of this patch.
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
alpha
scalar or None
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
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
path
unknown
path_effects
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
Curve with error band
Stairs Demo
Image Demo
Box plots with custom fill colors
Using a text as a Path
Reference for Matplotlib artists
Compound path
Dolphins
Mmh Donuts!!!
PathPatch object
Bezier Curve
Firefox
Path Editor
Building histograms using Rectangles and PolyCollections
Matplotlib logo
TickedStroke patheffect
Draw flat objects in 3D plot
Path Tutorial


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
alpha
scalar or None
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
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
path
unknown
path_effects
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


Bases: matplotlib.patches.Patch
A general polygon patch.
xy is a numpy array with shape Nx2.
If closed is True, the polygon will be closed so the starting and ending points are the same.
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
alpha
unknown
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
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
path_effects
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
Return whether the polygon is closed.
Get the Path of the polygon.
Get the vertices of the path.
The coordinates of the vertices.
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
alpha
scalar or None
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
closed
bool
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
path_effects
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
xy
(N, 2) array-like
zorder
float
Set whether the polygon is closed.
True if the polygon is closed
Set the vertices of the polygon.
The coordinates of the vertices.
Unlike Path, we do not ignore the last input vertex. If the polygon is meant to be closed, and the last point of the polygon is not equal to the first, we assume that the user has not explicitly passed a CLOSEPOLY vertex, and add it ourselves.
The vertices of the path as (N, 2) numpy array.
Controlling view limits using margins and sticky_edges
Boxplots
Arrow guide
Hatch demo
Circles, Wedges and Polygons
mpl_toolkits.axisartist.floating_axes features
Integral as the area under a curve
Poly Editor
Trifinder Event Demo
Annotations


Get the vertices of the path.
The coordinates of the vertices.


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
alpha
scalar or None
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
closed
bool
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
path_effects
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
xy
(N, 2) array-like
zorder
float


Set whether the polygon is closed.
True if the polygon is closed


Set the vertices of the polygon.
The coordinates of the vertices.
Unlike Path, we do not ignore the last input vertex. If the polygon is meant to be closed, and the last point of the polygon is not equal to the first, we assume that the user has not explicitly passed a CLOSEPOLY vertex, and add it ourselves.


Bases: matplotlib.patches.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.
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 xy.
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
alpha
unknown
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
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
path_effects
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 the rotation angle in degrees.
Return the Bbox.
Return the height of the rectangle.
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.
Return the vertices of the rectangle.
Return the width of the rectangle.
Return the left coordinate of the rectangle.
Return the left and bottom coords of the rectangle as a tuple.
Return the bottom coordinate of the rectangle.
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
alpha
scalar or None
angle
unknown
animated
bool
antialiased or aa
bool or None
bounds
(left, bottom, width, height)
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
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
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
path_effects
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
width
unknown
x
unknown
xy
(float, float)
y
unknown
zorder
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 the height of the rectangle.
Set the width of the rectangle.
Set the left coordinate of the rectangle.
Set the left and bottom coordinates of the rectangle.
Set the bottom coordinate of the rectangle.
Return the left and bottom coords of the rectangle as a tuple.
Creating boxes from error bars using PatchCollection
Histograms
Text Rotation Mode
Precise text layout
Fig Axes Customize Simple
Text Layout
List of named colors
Reference for Matplotlib artists
Hatch style reference
Inset Locator Demo
Anatomy of a figure
Pick Event Demo
Viewlims
Changing colors of lines intersecting a box
Matplotlib logo
Hinton diagrams
Artist tests
Menu
Artist tutorial
Legend guide
Transformations Tutorial
Specifying Colors
Text properties and layout


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.


Return the left coordinate of the rectangle.


Return the left and bottom coords of the rectangle as a tuple.


Return the bottom coordinate of the rectangle.


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
alpha
scalar or None
angle
unknown
animated
bool
antialiased or aa
bool or None
bounds
(left, bottom, width, height)
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
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
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
path_effects
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
width
unknown
x
unknown
xy
(float, float)
y
unknown
zorder
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 the left coordinate of the rectangle.


Set the left and bottom coordinates of the rectangle.


Set the bottom coordinate of the rectangle.


Bases: matplotlib.patches.Patch
A regular polygon patch.
The center position.
The number of vertices.
The distance from the center to each of the vertices.
The polygon rotation angle (in radians).
Patch 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
alpha
unknown
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
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
path_effects
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
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.
Return the path of this patch.
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
alpha
scalar or None
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
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
path_effects
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
Reference for Matplotlib artists
Radar chart (aka spider or star chart)


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
alpha
scalar or None
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
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
path_effects
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


Bases: matplotlib.patches.Patch
Create a shadow of the given patch.
By default, the shadow will have the same face color as the patch, but darkened.
The patch to create the shadow for.
The shift of the shadow in data coordinates, scaled by a factor of dpi/72.
Properties of the shadow patch. Supported keys 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
alpha
unknown
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
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
path_effects
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
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible (Artist.get_visible returns False).
This method is overridden in the Artist subclasses.
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.
Return the path of this patch.
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
alpha
scalar or None
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
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
path_effects
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
Using a text as a Path
SVG Filter Pie


Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible (Artist.get_visible returns False).
This method is overridden in the Artist subclasses.


Bases: matplotlib.patches.PathPatch
A path patch describing a stepwise constant function.
By default the path is not closed and starts and stops at baseline value.
The step heights.
The edge positions, with len(edges) == len(vals) + 1, between which the curve takes on vals values.
The direction of the steps. Vertical means that values are along the y-axis, and edges are along the x-axis.
The bottom value of the bounding edges or when fill=True, position of lower edge. If fill is True or an array is passed to baseline, a closed path is drawn.
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
alpha
unknown
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
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
path_effects
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 StepPatch values, edges and baseline as namedtuple.
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
alpha
scalar or None
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
color
color
data
1D array-like or None
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
path
unknown
path_effects
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
Set StepPatch values, edges and baseline.
Will not update values, if passing None
Stairs Demo


Get StepPatch values, edges and baseline as namedtuple.


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
alpha
scalar or None
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
color
color
data
1D array-like or None
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
path
unknown
path_effects
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


Set StepPatch values, edges and baseline.
Will not update values, if passing None


Bases: matplotlib.patches.Patch
Wedge shaped patch.
A wedge centered at x, y center with radius r that sweeps theta1 to theta2 (in degrees). If width is given, then a partial wedge is drawn from inner radius r - width to outer radius r.
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
alpha
unknown
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
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
path_effects
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
Return the path of this patch.
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
alpha
scalar or None
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
center
unknown
clip_box
Bbox
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
path_effects
AbstractPathEffect
picker
None or bool or float or callable
radius
unknown
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
theta1
unknown
theta2
unknown
transform
Transform
url
str
visible
bool
width
unknown
zorder
float
Labeling a pie and a donut
Reference for Matplotlib artists
Circles, Wedges and Polygons
SVG Filter Pie


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
alpha
scalar or None
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
center
unknown
clip_box
Bbox
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
path_effects
AbstractPathEffect
picker
None or bool or float or callable
radius
unknown
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
theta1
unknown
theta2
unknown
transform
Transform
url
str
visible
bool
width
unknown
zorder
float