classmatplotlib.offsetbox.OffsetBox(*args, **kwargs)[source]

Bases: matplotlib.artist.Artist The OffsetBox is a simple container artist. The child artists are meant to be drawn at a relative position to its parent. Being an artist itself, all parameters are passed on to Artist.   propertyaxes

The Axes instance the artist resides in, or None.
   contains(mouseevent)[source]

Delegate the mouse event contains-check to the children. As a container, the OffsetBox does not respond itself to mouseevents.  Parameters

mouseeventmatplotlib.backend_bases.MouseEvent

  Returns

containsbool

Whether any values are within the radius.
detailsdict

An artist-specific dictionary of details of the event context, such as which points are contained in the pick radius. See the individual Artist subclasses for details.      See also  Artist.contains

   draw(renderer)[source]

Update the location of children if necessary and draw them to the given renderer.
   get_children()[source]

Return a list of the child Artists.
   get_extent(renderer)[source]

Return a tuple width, height, xdescent, ydescent of the box.
   get_extent_offsets(renderer)[source]

Update offset of the children and return the extent of the box.  Parameters

rendererRendererBase subclass

  Returns
 width
height
xdescent
ydescent
list of (xoffset, yoffset) pairs

   get_offset(width, height, xdescent, ydescent, renderer)[source]

Return the offset as a tuple (x, y). The extent parameters have to be provided to handle the case where the offset is dynamically determined by a callable (see set_offset).  Parameters
 width, height, xdescent, ydescent

Extent parameters.
rendererRendererBase subclass

   get_visible_children()[source]

Return a list of the visible child Artists.
   get_window_extent(renderer)[source]

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(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, gid=<UNSET>, height=<UNSET>, in_layout=<UNSET>, label=<UNSET>, offset=<UNSET>, path_effects=<UNSET>, picker=<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
alpha scalar or None
animated bool
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
figure Figure
gid str
height float
in_layout bool
label object
offset (float, float) or callable
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_figure(fig)[source]

Set the Figure for the OffsetBox and all its children.  Parameters

figFigure

   set_height(height)[source]

Set the height of the box.  Parameters

heightfloat

   set_offset(xy)[source]

Set the offset.  Parameters

xy(float, float) or callable

The (x, y) coordinates of the offset in display units. These can either be given explicitly as a tuple (x, y), or by providing a function that converts the extent into the offset. This function must have the signature: def offset(width, height, xdescent, ydescent, renderer) -> (float, float)

   set_width(width)[source]

Set the width of the box.  Parameters

widthfloat


contains(mouseevent)[source]

Delegate the mouse event contains-check to the children. As a container, the OffsetBox does not respond itself to mouseevents.  Parameters

mouseeventmatplotlib.backend_bases.MouseEvent

  Returns

containsbool

Whether any values are within the radius.
detailsdict

An artist-specific dictionary of details of the event context, such as which points are contained in the pick radius. See the individual Artist subclasses for details.      See also  Artist.contains


draw(renderer)[source]

Update the location of children if necessary and draw them to the given renderer.


get_children()[source]

Return a list of the child Artists.


get_extent(renderer)[source]

Return a tuple width, height, xdescent, ydescent of the box.


get_extent_offsets(renderer)[source]

Update offset of the children and return the extent of the box.  Parameters

rendererRendererBase subclass

  Returns
 width
height
xdescent
ydescent
list of (xoffset, yoffset) pairs


get_offset(width, height, xdescent, ydescent, renderer)[source]

Return the offset as a tuple (x, y). The extent parameters have to be provided to handle the case where the offset is dynamically determined by a callable (see set_offset).  Parameters
 width, height, xdescent, ydescent

Extent parameters.
rendererRendererBase subclass


get_visible_children()[source]

Return a list of the visible child Artists.


get_window_extent(renderer)[source]

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(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, gid=<UNSET>, height=<UNSET>, in_layout=<UNSET>, label=<UNSET>, offset=<UNSET>, path_effects=<UNSET>, picker=<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
alpha scalar or None
animated bool
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
figure Figure
gid str
height float
in_layout bool
label object
offset (float, float) or callable
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_figure(fig)[source]

Set the Figure for the OffsetBox and all its children.  Parameters

figFigure


set_height(height)[source]

Set the height of the box.  Parameters

heightfloat


set_offset(xy)[source]

Set the offset.  Parameters

xy(float, float) or callable

The (x, y) coordinates of the offset in display units. These can either be given explicitly as a tuple (x, y), or by providing a function that converts the extent into the offset. This function must have the signature: def offset(width, height, xdescent, ydescent, renderer) -> (float, float)


set_width(width)[source]

Set the width of the box.  Parameters

widthfloat


classmatplotlib.offsetbox.OffsetImage(arr, zoom=1, cmap=None, norm=None, interpolation=None, origin=None, filternorm=True, filterrad=4.0, resample=False, dpi_cor=True, **kwargs)[source]

Bases: matplotlib.offsetbox.OffsetBox   draw(renderer)[source]

Update the location of children if necessary and draw them to the given renderer.
   get_children()[source]

Return a list of the child Artists.
   get_data()[source]

   get_extent(renderer)[source]

Return a tuple width, height, xdescent, ydescent of the box.
   get_offset()[source]

Return offset of the container.
   get_window_extent(renderer)[source]

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.
   get_zoom()[source]

   set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, data=<UNSET>, gid=<UNSET>, height=<UNSET>, in_layout=<UNSET>, label=<UNSET>, offset=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, width=<UNSET>, zoom=<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
alpha scalar or None
animated bool
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
data unknown
figure Figure
gid str
height float
in_layout bool
label object
offset (float, float) or callable
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
zoom unknown
zorder float
   set_data(arr)[source]

   set_zoom(zoom)[source]


get_offset()[source]

Return offset of the container.


set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, data=<UNSET>, gid=<UNSET>, height=<UNSET>, in_layout=<UNSET>, label=<UNSET>, offset=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, width=<UNSET>, zoom=<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
alpha scalar or None
animated bool
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
data unknown
figure Figure
gid str
height float
in_layout bool
label object
offset (float, float) or callable
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
zoom unknown
zorder float


classmatplotlib.offsetbox.PackerBase(pad=None, sep=None, width=None, height=None, align='baseline', mode='fixed', children=None)[source]

Bases: matplotlib.offsetbox.OffsetBox  Parameters

padfloat, optional

The boundary padding in points.
sepfloat, optional

The spacing between items in points.
width, heightfloat, optional

Width and height of the container box in pixels, calculated if None.
align{'top', 'bottom', 'left', 'right', 'center', 'baseline'}, default: 'baseline'

Alignment of boxes.
mode{'fixed', 'expand', 'equal'}, default: 'fixed'

The packing mode.  'fixed' packs the given Artists tight with sep spacing. 'expand' uses the maximal available space to distribute the artists with equal spacing in between. 'equal': Each artist an equal fraction of the available space and is left-aligned (or top-aligned) therein.
childrenlist of Artist

The artists to pack.     Notes pad and sep are in points and will be scaled with the renderer dpi, while width and height are in pixels.   set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, gid=<UNSET>, height=<UNSET>, in_layout=<UNSET>, label=<UNSET>, offset=<UNSET>, path_effects=<UNSET>, picker=<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
alpha scalar or None
animated bool
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
figure Figure
gid str
height float
in_layout bool
label object
offset (float, float) or callable
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


classmatplotlib.offsetbox.PaddedBox(child, pad=None, draw_frame=False, patch_attrs=None)[source]

Bases: matplotlib.offsetbox.OffsetBox A container to add a padding around an Artist. The PaddedBox contains a FancyBboxPatch that is used to visualize it when rendering.  Parameters

childArtist

The contained Artist.
padfloat

The padding in points. This will be scaled with the renderer dpi. In contrast width and height are in pixels and thus not scaled.
draw_framebool

Whether to draw the contained FancyBboxPatch.
patch_attrsdict or None

Additional parameters passed to the contained FancyBboxPatch.       draw(renderer)[source]

Update the location of children if necessary and draw them to the given renderer.
   draw_frame(renderer)[source]

   get_extent_offsets(renderer)[source]

Update offset of the children and return the extent of the box.  Parameters

rendererRendererBase subclass

  Returns
 width
height
xdescent
ydescent
list of (xoffset, yoffset) pairs

   set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, gid=<UNSET>, height=<UNSET>, in_layout=<UNSET>, label=<UNSET>, offset=<UNSET>, path_effects=<UNSET>, picker=<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
alpha scalar or None
animated bool
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
figure Figure
gid str
height float
in_layout bool
label object
offset (float, float) or callable
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
   update_frame(bbox, fontsize=None)[source]


draw(renderer)[source]

Update the location of children if necessary and draw them to the given renderer.


classmatplotlib.offsetbox.TextArea(s, textprops=None, multilinebaseline=False, minimumdescent=<deprecated parameter>)[source]

Bases: matplotlib.offsetbox.OffsetBox The TextArea is a container artist for a single Text instance. The text is placed at (0, 0) with baseline+left alignment, by default. The width and height of the TextArea instance is the width and height of its child text.  Parameters

sstr

The text to be displayed.
textpropsdict, default: {}

Dictionary of keyword parameters to be passed to the Text instance in the TextArea.
multilinebaselinebool, default: False

Whether the baseline for multiline text is adjusted so that it is (approximately) center-aligned with single-line text.
minimumdescentbool, default: True

If True, the box has a minimum descent of "p". This is now effectively always True.       draw(renderer)[source]

Update the location of children if necessary and draw them to the given renderer.
   get_extent(renderer)[source]

Return a tuple width, height, xdescent, ydescent of the box.
   get_minimumdescent()[source]

[Deprecated] Get minimumdescent. Notes  Deprecated since version 3.4.
   get_multilinebaseline()[source]

Get multilinebaseline.
   get_offset()[source]

Return offset of the container.
   get_text()[source]

Return the string representation of this area's text.
   get_window_extent(renderer)[source]

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(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, gid=<UNSET>, height=<UNSET>, in_layout=<UNSET>, label=<UNSET>, minimumdescent=<UNSET>, multilinebaseline=<UNSET>, offset=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, text=<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
alpha scalar or None
animated bool
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
figure Figure
gid str
height float
in_layout bool
label object
minimumdescent unknown
multilinebaseline unknown
offset (float, 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
text unknown
transform unknown
url str
visible bool
width float
zorder float
   set_minimumdescent(t)[source]

[Deprecated] Set minimumdescent. If True, extent of the single line text is adjusted so that its descent is at least the one of the glyph "p". Notes  Deprecated since version 3.4.
   set_multilinebaseline(t)[source]

Set multilinebaseline. If True, the baseline for multiline text is adjusted so that it is (approximately) center-aligned with single-line text. This is used e.g. by the legend implementation so that single-line labels are baseline-aligned, but multiline labels are "center"-aligned with them.
   set_offset(xy)[source]

Set the offset of the container.  Parameters

xy(float, float)

The (x, y) coordinates of the offset in display units.
   set_text(s)[source]

Set the text of this area as a string.
   set_transform(t)[source]

set_transform is ignored.


get_extent(renderer)[source]

Return a tuple width, height, xdescent, ydescent of the box.


get_minimumdescent()[source]

[Deprecated] Get minimumdescent. Notes  Deprecated since version 3.4.


get_multilinebaseline()[source]

Get multilinebaseline.


get_text()[source]

Return the string representation of this area's text.


get_window_extent(renderer)[source]

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(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, gid=<UNSET>, height=<UNSET>, in_layout=<UNSET>, label=<UNSET>, minimumdescent=<UNSET>, multilinebaseline=<UNSET>, offset=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, text=<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
alpha scalar or None
animated bool
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
figure Figure
gid str
height float
in_layout bool
label object
minimumdescent unknown
multilinebaseline unknown
offset (float, 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
text unknown
transform unknown
url str
visible bool
width float
zorder float


set_minimumdescent(t)[source]

[Deprecated] Set minimumdescent. If True, extent of the single line text is adjusted so that its descent is at least the one of the glyph "p". Notes  Deprecated since version 3.4.


set_multilinebaseline(t)[source]

Set multilinebaseline. If True, the baseline for multiline text is adjusted so that it is (approximately) center-aligned with single-line text. This is used e.g. by the legend implementation so that single-line labels are baseline-aligned, but multiline labels are "center"-aligned with them.


set_offset(xy)[source]

Set the offset of the container.  Parameters

xy(float, float)

The (x, y) coordinates of the offset in display units.


set_text(s)[source]

Set the text of this area as a string.


set_transform(t)[source]

set_transform is ignored.


classmatplotlib.offsetbox.VPacker(pad=None, sep=None, width=None, height=None, align='baseline', mode='fixed', children=None)[source]

Bases: matplotlib.offsetbox.PackerBase VPacker packs its children vertically, automatically adjusting their relative positions at draw time.  Parameters

padfloat, optional

The boundary padding in points.
sepfloat, optional

The spacing between items in points.
width, heightfloat, optional

Width and height of the container box in pixels, calculated if None.
align{'top', 'bottom', 'left', 'right', 'center', 'baseline'}, default: 'baseline'

Alignment of boxes.
mode{'fixed', 'expand', 'equal'}, default: 'fixed'

The packing mode.  'fixed' packs the given Artists tight with sep spacing. 'expand' uses the maximal available space to distribute the artists with equal spacing in between. 'equal': Each artist an equal fraction of the available space and is left-aligned (or top-aligned) therein.
childrenlist of Artist

The artists to pack.     Notes pad and sep are in points and will be scaled with the renderer dpi, while width and height are in pixels.   get_extent_offsets(renderer)[source]

Update offset of the children and return the extent of the box.  Parameters

rendererRendererBase subclass

  Returns
 width
height
xdescent
ydescent
list of (xoffset, yoffset) pairs

   set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, gid=<UNSET>, height=<UNSET>, in_layout=<UNSET>, label=<UNSET>, offset=<UNSET>, path_effects=<UNSET>, picker=<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
alpha scalar or None
animated bool
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
figure Figure
gid str
height float
in_layout bool
label object
offset (float, float) or callable
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


get_extent_offsets(renderer)[source]

Update offset of the children and return the extent of the box.  Parameters

rendererRendererBase subclass

  Returns
 width
height
xdescent
ydescent
list of (xoffset, yoffset) pairs


set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, gid=<UNSET>, height=<UNSET>, in_layout=<UNSET>, label=<UNSET>, offset=<UNSET>, path_effects=<UNSET>, picker=<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
alpha scalar or None
animated bool
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
figure Figure
gid str
height float
in_layout bool
label object
offset (float, float) or callable
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


matplotlib.patches                         Patches are Artists with a face color and an edge color.  Classes
Annulus(xy, r, width[, angle]) An elliptical annulus.
Arc(xy, width, height[, angle, theta1, theta2]) An elliptical arc, i.e. a segment of an ellipse.
Arrow(x, y, dx, dy[, width]) An arrow patch.
ArrowStyle(stylename, **kw) ArrowStyle is a container class which defines several arrowstyle classes, which is used to create an arrow path along a given path.
BoxStyle(stylename, **kw) BoxStyle is a container class which defines several boxstyle classes, which are used for FancyBboxPatch.
Circle(xy[, radius]) A circle patch.
CirclePolygon(xy[, radius, resolution]) A polygon-approximation of a circle patch.
ConnectionPatch(xyA, xyB, coordsA[, ...]) A patch that connects two points (possibly in different axes).
ConnectionStyle(stylename, **kw) ConnectionStyle is a container class which defines several connectionstyle classes, which is used to create a path between two points.
Ellipse(xy, width, height[, angle]) A scale-free ellipse.
FancyArrow(x, y, dx, dy[, width, ...]) Like Arrow, but lets you set head width and head height independently.
FancyArrowPatch([posA, posB, path, ...]) A fancy arrow patch.
FancyBboxPatch(xy, width, height[, ...]) A fancy box around a rectangle with lower left at xy = (x, y) with specified width and height.
Patch([edgecolor, facecolor, color, ...]) A patch is a 2D artist with a face color and an edge color.
PathPatch(path, **kwargs) A general polycurve path patch.
StepPatch(values, edges, *[, orientation, ...]) A path patch describing a stepwise constant function.
Polygon(xy[, closed]) A general polygon patch.
Rectangle(xy, width, height[, angle]) A rectangle defined via an anchor point xy and its width and height.
RegularPolygon(xy, numVertices[, radius, ...]) A regular polygon patch.
Shadow(patch, ox, oy, **kwargs) Create a shadow of the given patch.
Wedge(center, r, theta1, theta2[, width]) Wedge shaped patch.     Functions
bbox_artist(artist, renderer[, props, fill]) 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.
draw_bbox(bbox, renderer[, color, trans]) 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.


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

Bases: matplotlib.patches.Patch An elliptical annulus.  Parameters

xy(float, float)

xy coordinates of annulus centre.
rfloat or (float, float)

The radius, or semi-axes:  If float: radius of the outer circle. If two floats: semi-major and -minor axes of outer ellipse.
widthfloat

Width (thickness) of the annular ring. The width is measured inward from the outer ellipse so that for the inner ellipse the semi-axes are given by r - width. width must be less than or equal to the semi-minor axis.
anglefloat, default: 0

Rotation angle in degrees (anti-clockwise from the positive x-axis). Ignored for circular annuli (i.e., if r is a scalar).  **kwargs

Keyword arguments control the 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         propertyangle

Return the angle of the annulus.
   propertycenter

Return the center of the annulus.
   get_angle()[source]

Return the angle of the annulus.
   get_center()[source]

Return the center of the annulus.
   get_path()[source]

Return the path of this patch.
   get_radii()[source]

Return the semi-major and semi-minor radii of the annulus.
   get_width()[source]

Return the width (thickness) of the annulus ring.
   propertyradii

Return the semi-major and semi-minor radii of the annulus.
   set(*, agg_filter=<UNSET>, alpha=<UNSET>, angle=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, capstyle=<UNSET>, center=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, radii=<UNSET>, rasterized=<UNSET>, semimajor=<UNSET>, semiminor=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, width=<UNSET>, zorder=<UNSET>)[source]

Set multiple properties at once. Supported properties are
Property Description
agg_filter a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
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', '.', '*'}
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
radii float or (float, float)
rasterized bool
semimajor float
semiminor float
sketch_params (scale: float, length: float, randomness: float)
snap bool or None
transform Transform
url str
visible bool
width float
zorder float
   set_angle(angle)[source]

Set the tilt angle of the annulus.  Parameters

anglefloat

   set_center(xy)[source]

Set the center of the annulus.  Parameters

xy(float, float)

   set_radii(r)[source]

Set the semi-major (a) and semi-minor radii (b) of the annulus.  Parameters

rfloat or (float, float)

The radius, or semi-axes:  If float: radius of the outer circle. If two floats: semi-major and -minor axes of outer ellipse.
   set_semimajor(a)[source]

Set the semi-major axis a of the annulus.  Parameters

afloat

   set_semiminor(b)[source]

Set the semi-minor axis b of the annulus.  Parameters

bfloat

   set_width(width)[source]

Set the width (thickness) of the annulus ring. The width is measured inwards from the outer ellipse.  Parameters

widthfloat

   propertywidth

Return the width (thickness) of the annulus ring.


get_angle()[source]

Return the angle of the annulus.


get_center()[source]

Return the center of the annulus.


get_path()[source]

Return the path of this patch.


get_radii()[source]

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


get_width()[source]

Return the width (thickness) of the annulus ring.


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>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, radii=<UNSET>, rasterized=<UNSET>, semimajor=<UNSET>, semiminor=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, width=<UNSET>, zorder=<UNSET>)[source]

Set multiple properties at once. Supported properties are
Property Description
agg_filter a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
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', '.', '*'}
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
radii float or (float, float)
rasterized bool
semimajor float
semiminor float
sketch_params (scale: float, length: float, randomness: float)
snap bool or None
transform Transform
url str
visible bool
width float
zorder float


set_angle(angle)[source]

Set the tilt angle of the annulus.  Parameters

anglefloat


set_center(xy)[source]

Set the center of the annulus.  Parameters

xy(float, float)


set_radii(r)[source]

Set the semi-major (a) and semi-minor radii (b) of the annulus.  Parameters

rfloat or (float, float)

The radius, or semi-axes:  If float: radius of the outer circle. If two floats: semi-major and -minor axes of outer ellipse.


set_semimajor(a)[source]

Set the semi-major axis a of the annulus.  Parameters

afloat


set_semiminor(b)[source]

Set the semi-minor axis b of the annulus.  Parameters

bfloat


set_width(width)[source]

Set the width (thickness) of the annulus ring. The width is measured inwards from the outer ellipse.  Parameters

widthfloat


matplotlib.patches.Arc   classmatplotlib.patches.Arc(xy, width, height, angle=0.0, theta1=0.0, theta2=360.0, **kwargs)[source]

Bases: matplotlib.patches.Ellipse An elliptical arc, i.e. a segment of an ellipse. Due to internal optimizations, there are certain restrictions on using Arc:  The arc cannot be filled. The arc must be used in an Axes instance. It can not be added directly to a Figure because it is optimized to only render the segments that are inside the axes bounding box with high resolution.   Parameters

xy(float, float)

The center of the ellipse.
widthfloat

The length of the horizontal axis.
heightfloat

The length of the vertical axis.
anglefloat

Rotation of the ellipse in degrees (counterclockwise).
theta1, theta2float, default: 0, 360

Starting and ending angles of the arc in degrees. These values are relative to angle, e.g. if angle = 45 and theta1 = 90 the absolute starting angle is 135. Default theta1 = 0, theta2 = 360, i.e. a complete ellipse. The arc is drawn in the counterclockwise direction. Angles greater than or equal to 360, or smaller than 0, are represented by an equivalent angle in the range [0, 360), by taking the input value mod 360.    Other Parameters

**kwargsPatch properties

Most Patch properties are supported as keyword arguments, with the exception of fill and facecolor because filling is not 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         draw(renderer)[source]

Draw the arc to the given renderer. Notes Ellipses are normally drawn using an approximation that uses eight cubic Bezier splines. The error of this approximation is 1.89818e-6, according to this unverified source: Lancaster, Don. Approximating a Circle or an Ellipse Using Four Bezier Cubic Splines. https://www.tinaja.com/glib/ellipse4.pdf There is a use case where very large ellipses must be drawn with very high accuracy, and it is too expensive to render the entire ellipse with enough segments (either splines or line segments). Therefore, in the case where either radius of the ellipse is large enough that the error of the spline approximation will be visible (greater than one pixel offset from the ideal), a different technique is used. In that case, only the visible parts of the ellipse are drawn, with each visible arc using a fixed number of spline segments (8). The algorithm proceeds as follows:
The points where the ellipse intersects the axes bounding box are located. (This is done be performing an inverse transformation on the axes bbox such that it is relative to the unit circle -- this makes the intersection calculation much easier than doing rotated ellipse intersection directly). This uses the "line intersecting a circle" algorithm from: Vince, John. Geometry for Computer Graphics: Formulae, Examples & Proofs. London: Springer-Verlag, 2005.  The angles of each of the intersection points are calculated. Proceeding counterclockwise starting in the positive x-direction, each of the visible arc-segments between the pairs of vertices are drawn using the Bezier arc approximation technique implemented in Path.arc.
   set(*, agg_filter=<UNSET>, alpha=<UNSET>, angle=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, capstyle=<UNSET>, center=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, height=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, path_effects=<UNSET>, picker=<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
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

  Examples using matplotlib.patches.Arc

   Scale invariant angle label

   Ellipse With Units


draw(renderer)[source]

Draw the arc to the given renderer. Notes Ellipses are normally drawn using an approximation that uses eight cubic Bezier splines. The error of this approximation is 1.89818e-6, according to this unverified source: Lancaster, Don. Approximating a Circle or an Ellipse Using Four Bezier Cubic Splines. https://www.tinaja.com/glib/ellipse4.pdf There is a use case where very large ellipses must be drawn with very high accuracy, and it is too expensive to render the entire ellipse with enough segments (either splines or line segments). Therefore, in the case where either radius of the ellipse is large enough that the error of the spline approximation will be visible (greater than one pixel offset from the ideal), a different technique is used. In that case, only the visible parts of the ellipse are drawn, with each visible arc using a fixed number of spline segments (8). The algorithm proceeds as follows:
The points where the ellipse intersects the axes bounding box are located. (This is done be performing an inverse transformation on the axes bbox such that it is relative to the unit circle -- this makes the intersection calculation much easier than doing rotated ellipse intersection directly). This uses the "line intersecting a circle" algorithm from: Vince, John. Geometry for Computer Graphics: Formulae, Examples & Proofs. London: Springer-Verlag, 2005.  The angles of each of the intersection points are calculated. Proceeding counterclockwise starting in the positive x-direction, each of the visible arc-segments between the pairs of vertices are drawn using the Bezier arc approximation technique implemented in Path.arc.


set(*, agg_filter=<UNSET>, alpha=<UNSET>, angle=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, capstyle=<UNSET>, center=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, height=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, path_effects=<UNSET>, picker=<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
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


matplotlib.patches.Arrow   classmatplotlib.patches.Arrow(x, y, dx, dy, width=1.0, **kwargs)[source]

Bases: matplotlib.patches.Patch An arrow patch. Draws an arrow from (x, y) to (x + dx, y + dy). The width of the arrow is scaled by width.  Parameters

xfloat

x coordinate of the arrow tail.
yfloat

y coordinate of the arrow tail.
dxfloat

Arrow length in the x direction.
dyfloat

Arrow length in the y direction.
widthfloat, default: 1

Scale factor for the width of the arrow. With a default value of 1, the tail width is 0.2 and head width is 0.6.  **kwargs

Keyword arguments control the 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        See also  FancyArrow

Patch that allows independent control of the head and tail properties.      get_patch_transform()[source]

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.
   get_path()[source]

Return the path of this patch.
   set(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, capstyle=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<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
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

  Examples using matplotlib.patches.Arrow

   Arrow guide

   Reference for Matplotlib artists


get_patch_transform()[source]

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(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, capstyle=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<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
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


matplotlib.patches.ArrowStyle   classmatplotlib.patches.ArrowStyle(stylename, **kw)[source]

Bases: matplotlib.patches._Style ArrowStyle is a container class which defines several arrowstyle classes, which is used to create an arrow path along a given path. These are mainly used with FancyArrowPatch. A arrowstyle object can be either created as: ArrowStyle.Fancy(head_length=.4, head_width=.4, tail_width=.4)
 or: ArrowStyle("Fancy", head_length=.4, head_width=.4, tail_width=.4)
 or: ArrowStyle("Fancy, head_length=.4, head_width=.4, tail_width=.4")
 The following classes are defined
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   An instance of any arrow style class is a callable object, whose call signature is: __call__(self, path, mutation_size, linewidth, aspect_ratio=1.)
 and it returns a tuple of a Path instance and a boolean value. path is a Path instance along which the arrow will be drawn. mutation_size and aspect_ratio have the same meaning as in BoxStyle. linewidth is a line width to be stroked. This is meant to be used to correct the location of the head so that it does not overshoot the destination point, but not all classes support it. Return the instance of the subclass with the given style name.   classBarAB(widthA=1.0, angleA=0, widthB=1.0, angleB=0)[source]

Bases: matplotlib.patches.ArrowStyle._Curve An arrow with vertical bars | at both ends.  Parameters

widthA, widthBfloat, default: 1.0

Width of the bracket.
angleA, angleBfloat, default: 0 degrees

Orientation of the bracket, as a counterclockwise angle. 0 degrees means perpendicular to the line.       arrow='|-|'

   classBracketA(widthA=1.0, lengthA=0.2, angleA=0)[source]

Bases: matplotlib.patches.ArrowStyle._Curve An arrow with an outward square bracket at its start.  Parameters

widthAfloat, default: 1.0

Width of the bracket.
lengthAfloat, default: 0.2

Length of the bracket.
angleAfloat, default: 0 degrees

Orientation of the bracket, as a counterclockwise angle. 0 degrees means perpendicular to the line.       arrow=']-'

   classBracketAB(widthA=1.0, lengthA=0.2, angleA=0, widthB=1.0, lengthB=0.2, angleB=0)[source]

Bases: matplotlib.patches.ArrowStyle._Curve An arrow with outward square brackets at both ends.  Parameters

widthA, widthBfloat, default: 1.0

Width of the bracket.
lengthA, lengthBfloat, default: 0.2

Length of the bracket.
angleA, angleBfloat, default: 0 degrees

Orientation of the bracket, as a counterclockwise angle. 0 degrees means perpendicular to the line.       arrow=']-['

   classBracketB(widthB=1.0, lengthB=0.2, angleB=0)[source]

Bases: matplotlib.patches.ArrowStyle._Curve An arrow with an outward square bracket at its end.  Parameters

widthBfloat, default: 1.0

Width of the bracket.
lengthBfloat, default: 0.2

Length of the bracket.
angleBfloat, default: 0 degrees

Orientation of the bracket, as a counterclockwise angle. 0 degrees means perpendicular to the line.       arrow='-['

   classBracketCurve(widthA=1.0, lengthA=0.2, angleA=None)[source]

Bases: matplotlib.patches.ArrowStyle._Curve An arrow with an outward square bracket at its start and a head at the end.  Parameters

widthAfloat, default: 1.0

Width of the bracket.
lengthAfloat, default: 0.2

Length of the bracket.
angleAfloat, default: 0 degrees

Orientation of the bracket, as a counterclockwise angle. 0 degrees means perpendicular to the line.       arrow=']->'

   classCurve[source]

Bases: matplotlib.patches.ArrowStyle._Curve A simple curve without any arrow head.  Parameters

head_lengthfloat, default: 0.4

Length of the arrow head, relative to mutation_scale.
head_widthfloat, default: 0.2

Width of the arrow head, relative to mutation_scale.
widthAfloat, default: 1.0

Width of the bracket at the beginning of the arrow
widthBfloat, default: 1.0

Width of the bracket at the end of the arrow
lengthAfloat, default: 0.2

Length of the bracket at the beginning of the arrow
lengthBfloat, default: 0.2

Length of the bracket at the end of the arrow
angleAfloat, default 0

Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
angleBfloat, default 0

Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
scaleAfloat, default mutation_size

The mutation_size for the beginning bracket
scaleBfloat, default mutation_size

The mutation_size for the end bracket
   classCurveA(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)[source]

Bases: matplotlib.patches.ArrowStyle._Curve An arrow with a head at its begin point.  Parameters

head_lengthfloat, default: 0.4

Length of the arrow head, relative to mutation_scale.
head_widthfloat, default: 0.2

Width of the arrow head, relative to mutation_scale.
widthAfloat, default: 1.0

Width of the bracket at the beginning of the arrow
widthBfloat, default: 1.0

Width of the bracket at the end of the arrow
lengthAfloat, default: 0.2

Length of the bracket at the beginning of the arrow
lengthBfloat, default: 0.2

Length of the bracket at the end of the arrow
angleAfloat, default 0

Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
angleBfloat, default 0

Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
scaleAfloat, default mutation_size

The mutation_size for the beginning bracket
scaleBfloat, default mutation_size

The mutation_size for the end bracket       arrow='<-'

   classCurveAB(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)[source]

Bases: matplotlib.patches.ArrowStyle._Curve An arrow with heads both at the begin and the end point.  Parameters

head_lengthfloat, default: 0.4

Length of the arrow head, relative to mutation_scale.
head_widthfloat, default: 0.2

Width of the arrow head, relative to mutation_scale.
widthAfloat, default: 1.0

Width of the bracket at the beginning of the arrow
widthBfloat, default: 1.0

Width of the bracket at the end of the arrow
lengthAfloat, default: 0.2

Length of the bracket at the beginning of the arrow
lengthBfloat, default: 0.2

Length of the bracket at the end of the arrow
angleAfloat, default 0

Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
angleBfloat, default 0

Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
scaleAfloat, default mutation_size

The mutation_size for the beginning bracket
scaleBfloat, default mutation_size

The mutation_size for the end bracket       arrow='<->'

   classCurveB(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)[source]

Bases: matplotlib.patches.ArrowStyle._Curve An arrow with a head at its end point.  Parameters

head_lengthfloat, default: 0.4

Length of the arrow head, relative to mutation_scale.
head_widthfloat, default: 0.2

Width of the arrow head, relative to mutation_scale.
widthAfloat, default: 1.0

Width of the bracket at the beginning of the arrow
widthBfloat, default: 1.0

Width of the bracket at the end of the arrow
lengthAfloat, default: 0.2

Length of the bracket at the beginning of the arrow
lengthBfloat, default: 0.2

Length of the bracket at the end of the arrow
angleAfloat, default 0

Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
angleBfloat, default 0

Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
scaleAfloat, default mutation_size

The mutation_size for the beginning bracket
scaleBfloat, default mutation_size

The mutation_size for the end bracket       arrow='->'

   classCurveBracket(widthB=1.0, lengthB=0.2, angleB=None)[source]

Bases: matplotlib.patches.ArrowStyle._Curve An arrow with an outward square bracket at its end and a head at the start.  Parameters

widthBfloat, default: 1.0

Width of the bracket.
lengthBfloat, default: 0.2

Length of the bracket.
angleBfloat, default: 0 degrees

Orientation of the bracket, as a counterclockwise angle. 0 degrees means perpendicular to the line.       arrow='<-['

   classCurveFilledA(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)[source]

Bases: matplotlib.patches.ArrowStyle._Curve An arrow with filled triangle head at the begin.  Parameters

head_lengthfloat, default: 0.4

Length of the arrow head, relative to mutation_scale.
head_widthfloat, default: 0.2

Width of the arrow head, relative to mutation_scale.
widthAfloat, default: 1.0

Width of the bracket at the beginning of the arrow
widthBfloat, default: 1.0

Width of the bracket at the end of the arrow
lengthAfloat, default: 0.2

Length of the bracket at the beginning of the arrow
lengthBfloat, default: 0.2

Length of the bracket at the end of the arrow
angleAfloat, default 0

Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
angleBfloat, default 0

Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
scaleAfloat, default mutation_size

The mutation_size for the beginning bracket
scaleBfloat, default mutation_size

The mutation_size for the end bracket       arrow='<|-'

   classCurveFilledAB(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)[source]

Bases: matplotlib.patches.ArrowStyle._Curve An arrow with filled triangle heads at both ends.  Parameters

head_lengthfloat, default: 0.4

Length of the arrow head, relative to mutation_scale.
head_widthfloat, default: 0.2

Width of the arrow head, relative to mutation_scale.
widthAfloat, default: 1.0

Width of the bracket at the beginning of the arrow
widthBfloat, default: 1.0

Width of the bracket at the end of the arrow
lengthAfloat, default: 0.2

Length of the bracket at the beginning of the arrow
lengthBfloat, default: 0.2

Length of the bracket at the end of the arrow
angleAfloat, default 0

Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
angleBfloat, default 0

Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
scaleAfloat, default mutation_size

The mutation_size for the beginning bracket
scaleBfloat, default mutation_size

The mutation_size for the end bracket       arrow='<|-|>'

   classCurveFilledB(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)[source]

Bases: matplotlib.patches.ArrowStyle._Curve An arrow with filled triangle head at the end.  Parameters

head_lengthfloat, default: 0.4

Length of the arrow head, relative to mutation_scale.
head_widthfloat, default: 0.2

Width of the arrow head, relative to mutation_scale.
widthAfloat, default: 1.0

Width of the bracket at the beginning of the arrow
widthBfloat, default: 1.0

Width of the bracket at the end of the arrow
lengthAfloat, default: 0.2

Length of the bracket at the beginning of the arrow
lengthBfloat, default: 0.2

Length of the bracket at the end of the arrow
angleAfloat, default 0

Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
angleBfloat, default 0

Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
scaleAfloat, default mutation_size

The mutation_size for the beginning bracket
scaleBfloat, default mutation_size

The mutation_size for the end bracket       arrow='-|>'

   classFancy(head_length=0.4, head_width=0.4, tail_width=0.4)[source]

Bases: matplotlib.patches.ArrowStyle._Base A fancy arrow. Only works with a quadratic Bezier curve.  Parameters

head_lengthfloat, default: 0.4

Length of the arrow head.
head_widthfloat, default: 0.4

Width of the arrow head.
tail_widthfloat, default: 0.4

Width of the arrow tail.       transmute(path, mutation_size, linewidth)[source]

The transmute method is the very core of the ArrowStyle class and must be overridden in the subclasses. It receives the path object along which the arrow will be drawn, and the mutation_size, with which the arrow head etc. will be scaled. The linewidth may be used to adjust the path so that it does not pass beyond the given points. It returns a tuple of a Path instance and a boolean. The boolean value indicate whether the path can be filled or not. The return value can also be a list of paths and list of booleans of a same length.

   classSimple(head_length=0.5, head_width=0.5, tail_width=0.2)[source]

Bases: matplotlib.patches.ArrowStyle._Base A simple arrow. Only works with a quadratic Bezier curve.  Parameters

head_lengthfloat, default: 0.5

Length of the arrow head.
head_widthfloat, default: 0.5

Width of the arrow head.
tail_widthfloat, default: 0.2

Width of the arrow tail.       transmute(path, mutation_size, linewidth)[source]

The transmute method is the very core of the ArrowStyle class and must be overridden in the subclasses. It receives the path object along which the arrow will be drawn, and the mutation_size, with which the arrow head etc. will be scaled. The linewidth may be used to adjust the path so that it does not pass beyond the given points. It returns a tuple of a Path instance and a boolean. The boolean value indicate whether the path can be filled or not. The return value can also be a list of paths and list of booleans of a same length.

   classWedge(tail_width=0.3, shrink_factor=0.5)[source]

Bases: matplotlib.patches.ArrowStyle._Base Wedge(?) shape. Only works with a quadratic Bezier curve. The begin point has a width of the tail_width and the end point has a width of 0. At the middle, the width is shrink_factor*tail_width.  Parameters

tail_widthfloat, default: 0.3

Width of the tail.
shrink_factorfloat, default: 0.5

Fraction of the arrow width at the middle point.       transmute(path, mutation_size, linewidth)[source]

The transmute method is the very core of the ArrowStyle class and must be overridden in the subclasses. It receives the path object along which the arrow will be drawn, and the mutation_size, with which the arrow head etc. will be scaled. The linewidth may be used to adjust the path so that it does not pass beyond the given points. It returns a tuple of a Path instance and a boolean. The boolean value indicate whether the path can be filled or not. The return value can also be a list of paths and list of booleans of a same length.


classBarAB(widthA=1.0, angleA=0, widthB=1.0, angleB=0)[source]

Bases: matplotlib.patches.ArrowStyle._Curve An arrow with vertical bars | at both ends.  Parameters

widthA, widthBfloat, default: 1.0

Width of the bracket.
angleA, angleBfloat, default: 0 degrees

Orientation of the bracket, as a counterclockwise angle. 0 degrees means perpendicular to the line.       arrow='|-|'


classBracketA(widthA=1.0, lengthA=0.2, angleA=0)[source]

Bases: matplotlib.patches.ArrowStyle._Curve An arrow with an outward square bracket at its start.  Parameters

widthAfloat, default: 1.0

Width of the bracket.
lengthAfloat, default: 0.2

Length of the bracket.
angleAfloat, default: 0 degrees

Orientation of the bracket, as a counterclockwise angle. 0 degrees means perpendicular to the line.       arrow=']-'


classBracketAB(widthA=1.0, lengthA=0.2, angleA=0, widthB=1.0, lengthB=0.2, angleB=0)[source]

Bases: matplotlib.patches.ArrowStyle._Curve An arrow with outward square brackets at both ends.  Parameters

widthA, widthBfloat, default: 1.0

Width of the bracket.
lengthA, lengthBfloat, default: 0.2

Length of the bracket.
angleA, angleBfloat, default: 0 degrees

Orientation of the bracket, as a counterclockwise angle. 0 degrees means perpendicular to the line.       arrow=']-['


classBracketB(widthB=1.0, lengthB=0.2, angleB=0)[source]

Bases: matplotlib.patches.ArrowStyle._Curve An arrow with an outward square bracket at its end.  Parameters

widthBfloat, default: 1.0

Width of the bracket.
lengthBfloat, default: 0.2

Length of the bracket.
angleBfloat, default: 0 degrees

Orientation of the bracket, as a counterclockwise angle. 0 degrees means perpendicular to the line.       arrow='-['


classBracketCurve(widthA=1.0, lengthA=0.2, angleA=None)[source]

Bases: matplotlib.patches.ArrowStyle._Curve An arrow with an outward square bracket at its start and a head at the end.  Parameters

widthAfloat, default: 1.0

Width of the bracket.
lengthAfloat, default: 0.2

Length of the bracket.
angleAfloat, default: 0 degrees

Orientation of the bracket, as a counterclockwise angle. 0 degrees means perpendicular to the line.       arrow=']->'


classCurve[source]

Bases: matplotlib.patches.ArrowStyle._Curve A simple curve without any arrow head.  Parameters

head_lengthfloat, default: 0.4

Length of the arrow head, relative to mutation_scale.
head_widthfloat, default: 0.2

Width of the arrow head, relative to mutation_scale.
widthAfloat, default: 1.0

Width of the bracket at the beginning of the arrow
widthBfloat, default: 1.0

Width of the bracket at the end of the arrow
lengthAfloat, default: 0.2

Length of the bracket at the beginning of the arrow
lengthBfloat, default: 0.2

Length of the bracket at the end of the arrow
angleAfloat, default 0

Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
angleBfloat, default 0

Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
scaleAfloat, default mutation_size

The mutation_size for the beginning bracket
scaleBfloat, default mutation_size

The mutation_size for the end bracket


classCurveA(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)[source]

Bases: matplotlib.patches.ArrowStyle._Curve An arrow with a head at its begin point.  Parameters

head_lengthfloat, default: 0.4

Length of the arrow head, relative to mutation_scale.
head_widthfloat, default: 0.2

Width of the arrow head, relative to mutation_scale.
widthAfloat, default: 1.0

Width of the bracket at the beginning of the arrow
widthBfloat, default: 1.0

Width of the bracket at the end of the arrow
lengthAfloat, default: 0.2

Length of the bracket at the beginning of the arrow
lengthBfloat, default: 0.2

Length of the bracket at the end of the arrow
angleAfloat, default 0

Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
angleBfloat, default 0

Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
scaleAfloat, default mutation_size

The mutation_size for the beginning bracket
scaleBfloat, default mutation_size

The mutation_size for the end bracket       arrow='<-'


classCurveAB(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)[source]

Bases: matplotlib.patches.ArrowStyle._Curve An arrow with heads both at the begin and the end point.  Parameters

head_lengthfloat, default: 0.4

Length of the arrow head, relative to mutation_scale.
head_widthfloat, default: 0.2

Width of the arrow head, relative to mutation_scale.
widthAfloat, default: 1.0

Width of the bracket at the beginning of the arrow
widthBfloat, default: 1.0

Width of the bracket at the end of the arrow
lengthAfloat, default: 0.2

Length of the bracket at the beginning of the arrow
lengthBfloat, default: 0.2

Length of the bracket at the end of the arrow
angleAfloat, default 0

Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
angleBfloat, default 0

Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
scaleAfloat, default mutation_size

The mutation_size for the beginning bracket
scaleBfloat, default mutation_size

The mutation_size for the end bracket       arrow='<->'


classCurveB(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)[source]

Bases: matplotlib.patches.ArrowStyle._Curve An arrow with a head at its end point.  Parameters

head_lengthfloat, default: 0.4

Length of the arrow head, relative to mutation_scale.
head_widthfloat, default: 0.2

Width of the arrow head, relative to mutation_scale.
widthAfloat, default: 1.0

Width of the bracket at the beginning of the arrow
widthBfloat, default: 1.0

Width of the bracket at the end of the arrow
lengthAfloat, default: 0.2

Length of the bracket at the beginning of the arrow
lengthBfloat, default: 0.2

Length of the bracket at the end of the arrow
angleAfloat, default 0

Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
angleBfloat, default 0

Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
scaleAfloat, default mutation_size

The mutation_size for the beginning bracket
scaleBfloat, default mutation_size

The mutation_size for the end bracket       arrow='->'


classCurveBracket(widthB=1.0, lengthB=0.2, angleB=None)[source]

Bases: matplotlib.patches.ArrowStyle._Curve An arrow with an outward square bracket at its end and a head at the start.  Parameters

widthBfloat, default: 1.0

Width of the bracket.
lengthBfloat, default: 0.2

Length of the bracket.
angleBfloat, default: 0 degrees

Orientation of the bracket, as a counterclockwise angle. 0 degrees means perpendicular to the line.       arrow='<-['


classCurveFilledA(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)[source]

Bases: matplotlib.patches.ArrowStyle._Curve An arrow with filled triangle head at the begin.  Parameters

head_lengthfloat, default: 0.4

Length of the arrow head, relative to mutation_scale.
head_widthfloat, default: 0.2

Width of the arrow head, relative to mutation_scale.
widthAfloat, default: 1.0

Width of the bracket at the beginning of the arrow
widthBfloat, default: 1.0

Width of the bracket at the end of the arrow
lengthAfloat, default: 0.2

Length of the bracket at the beginning of the arrow
lengthBfloat, default: 0.2

Length of the bracket at the end of the arrow
angleAfloat, default 0

Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
angleBfloat, default 0

Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
scaleAfloat, default mutation_size

The mutation_size for the beginning bracket
scaleBfloat, default mutation_size

The mutation_size for the end bracket       arrow='<|-'


classCurveFilledAB(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)[source]

Bases: matplotlib.patches.ArrowStyle._Curve An arrow with filled triangle heads at both ends.  Parameters

head_lengthfloat, default: 0.4

Length of the arrow head, relative to mutation_scale.
head_widthfloat, default: 0.2

Width of the arrow head, relative to mutation_scale.
widthAfloat, default: 1.0

Width of the bracket at the beginning of the arrow
widthBfloat, default: 1.0

Width of the bracket at the end of the arrow
lengthAfloat, default: 0.2

Length of the bracket at the beginning of the arrow
lengthBfloat, default: 0.2

Length of the bracket at the end of the arrow
angleAfloat, default 0

Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
angleBfloat, default 0

Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
scaleAfloat, default mutation_size

The mutation_size for the beginning bracket
scaleBfloat, default mutation_size

The mutation_size for the end bracket       arrow='<|-|>'


classCurveFilledB(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)[source]

Bases: matplotlib.patches.ArrowStyle._Curve An arrow with filled triangle head at the end.  Parameters

head_lengthfloat, default: 0.4

Length of the arrow head, relative to mutation_scale.
head_widthfloat, default: 0.2

Width of the arrow head, relative to mutation_scale.
widthAfloat, default: 1.0

Width of the bracket at the beginning of the arrow
widthBfloat, default: 1.0

Width of the bracket at the end of the arrow
lengthAfloat, default: 0.2

Length of the bracket at the beginning of the arrow
lengthBfloat, default: 0.2

Length of the bracket at the end of the arrow
angleAfloat, default 0

Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
angleBfloat, default 0

Orientation of the bracket at the beginning, as a counterclockwise angle. 0 degrees means perpendicular to the line.
scaleAfloat, default mutation_size

The mutation_size for the beginning bracket
scaleBfloat, default mutation_size

The mutation_size for the end bracket       arrow='-|>'


classFancy(head_length=0.4, head_width=0.4, tail_width=0.4)[source]

Bases: matplotlib.patches.ArrowStyle._Base A fancy arrow. Only works with a quadratic Bezier curve.  Parameters

head_lengthfloat, default: 0.4

Length of the arrow head.
head_widthfloat, default: 0.4

Width of the arrow head.
tail_widthfloat, default: 0.4

Width of the arrow tail.       transmute(path, mutation_size, linewidth)[source]

The transmute method is the very core of the ArrowStyle class and must be overridden in the subclasses. It receives the path object along which the arrow will be drawn, and the mutation_size, with which the arrow head etc. will be scaled. The linewidth may be used to adjust the path so that it does not pass beyond the given points. It returns a tuple of a Path instance and a boolean. The boolean value indicate whether the path can be filled or not. The return value can also be a list of paths and list of booleans of a same length.


transmute(path, mutation_size, linewidth)[source]

The transmute method is the very core of the ArrowStyle class and must be overridden in the subclasses. It receives the path object along which the arrow will be drawn, and the mutation_size, with which the arrow head etc. will be scaled. The linewidth may be used to adjust the path so that it does not pass beyond the given points. It returns a tuple of a Path instance and a boolean. The boolean value indicate whether the path can be filled or not. The return value can also be a list of paths and list of booleans of a same length.


classSimple(head_length=0.5, head_width=0.5, tail_width=0.2)[source]

Bases: matplotlib.patches.ArrowStyle._Base A simple arrow. Only works with a quadratic Bezier curve.  Parameters

head_lengthfloat, default: 0.5

Length of the arrow head.
head_widthfloat, default: 0.5

Width of the arrow head.
tail_widthfloat, default: 0.2

Width of the arrow tail.       transmute(path, mutation_size, linewidth)[source]

The transmute method is the very core of the ArrowStyle class and must be overridden in the subclasses. It receives the path object along which the arrow will be drawn, and the mutation_size, with which the arrow head etc. will be scaled. The linewidth may be used to adjust the path so that it does not pass beyond the given points. It returns a tuple of a Path instance and a boolean. The boolean value indicate whether the path can be filled or not. The return value can also be a list of paths and list of booleans of a same length.


classWedge(tail_width=0.3, shrink_factor=0.5)[source]

Bases: matplotlib.patches.ArrowStyle._Base Wedge(?) shape. Only works with a quadratic Bezier curve. The begin point has a width of the tail_width and the end point has a width of 0. At the middle, the width is shrink_factor*tail_width.  Parameters

tail_widthfloat, default: 0.3

Width of the tail.
shrink_factorfloat, default: 0.5

Fraction of the arrow width at the middle point.       transmute(path, mutation_size, linewidth)[source]

The transmute method is the very core of the ArrowStyle class and must be overridden in the subclasses. It receives the path object along which the arrow will be drawn, and the mutation_size, with which the arrow head etc. will be scaled. The linewidth may be used to adjust the path so that it does not pass beyond the given points. It returns a tuple of a Path instance and a boolean. The boolean value indicate whether the path can be filled or not. The return value can also be a list of paths and list of booleans of a same length.


matplotlib.patches.bbox_artist   matplotlib.patches.bbox_artist(artist, renderer, props=None, fill=True)[source]

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. props is a dict of rectangle props with the additional property 'pad' that sets the padding around the bbox in points.


matplotlib.patches.BoxStyle   classmatplotlib.patches.BoxStyle(stylename, **kw)[source]

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: BoxStyle.Round(pad=0.2)
 or: BoxStyle("Round", pad=0.2)
 or: BoxStyle("Round, pad=0.2")
 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: __call__(self, x0, y0, width, height, mutation_size)
 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.   classCircle(pad=0.3)[source]

Bases: matplotlib.patches.BoxStyle._Base A circular box.  Parameters

padfloat, default: 0.3

The amount of padding around the original box.       __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]

Given the location and size of the box, return the path of the box around it.  Parameters

x0, y0, width, heightfloat

Location and size of the box.
mutation_sizefloat

A reference scale for the mutation.    Returns
 Path

   classDArrow(pad=0.3)[source]

Bases: matplotlib.patches.BoxStyle._Base A box in the shape of a two-way arrow.  Parameters

padfloat, default: 0.3

The amount of padding around the original box.       __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]

Given the location and size of the box, return the path of the box around it.  Parameters

x0, y0, width, heightfloat

Location and size of the box.
mutation_sizefloat

A reference scale for the mutation.    Returns
 Path

   classLArrow(pad=0.3)[source]

Bases: matplotlib.patches.BoxStyle._Base A box in the shape of a left-pointing arrow.  Parameters

padfloat, default: 0.3

The amount of padding around the original box.       __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]

Given the location and size of the box, return the path of the box around it.  Parameters

x0, y0, width, heightfloat

Location and size of the box.
mutation_sizefloat

A reference scale for the mutation.    Returns
 Path

   classRArrow(pad=0.3)[source]

Bases: matplotlib.patches.BoxStyle.LArrow A box in the shape of a right-pointing arrow.  Parameters

padfloat, default: 0.3

The amount of padding around the original box.       __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]

Given the location and size of the box, return the path of the box around it.  Parameters

x0, y0, width, heightfloat

Location and size of the box.
mutation_sizefloat

A reference scale for the mutation.    Returns
 Path

   classRound(pad=0.3, rounding_size=None)[source]

Bases: matplotlib.patches.BoxStyle._Base A box with round corners.  Parameters

padfloat, default: 0.3

The amount of padding around the original box.
rounding_sizefloat, default: pad

Radius of the corners.       __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]

Given the location and size of the box, return the path of the box around it.  Parameters

x0, y0, width, heightfloat

Location and size of the box.
mutation_sizefloat

A reference scale for the mutation.    Returns
 Path

   classRound4(pad=0.3, rounding_size=None)[source]

Bases: matplotlib.patches.BoxStyle._Base A box with rounded edges.  Parameters

padfloat, default: 0.3

The amount of padding around the original box.
rounding_sizefloat, default: pad/2

Rounding of edges.       __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]

Given the location and size of the box, return the path of the box around it.  Parameters

x0, y0, width, heightfloat

Location and size of the box.
mutation_sizefloat

A reference scale for the mutation.    Returns
 Path

   classRoundtooth(pad=0.3, tooth_size=None)[source]

Bases: matplotlib.patches.BoxStyle.Sawtooth A box with a rounded sawtooth outline.  Parameters

padfloat, default: 0.3

The amount of padding around the original box.
tooth_sizefloat, default: pad/2

Size of the sawtooth.       __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]

Given the location and size of the box, return the path of the box around it.  Parameters

x0, y0, width, heightfloat

Location and size of the box.
mutation_sizefloat

A reference scale for the mutation.    Returns
 Path

   classSawtooth(pad=0.3, tooth_size=None)[source]

Bases: matplotlib.patches.BoxStyle._Base A box with a sawtooth outline.  Parameters

padfloat, default: 0.3

The amount of padding around the original box.
tooth_sizefloat, default: pad/2

Size of the sawtooth.       __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]

Given the location and size of the box, return the path of the box around it.  Parameters

x0, y0, width, heightfloat

Location and size of the box.
mutation_sizefloat

A reference scale for the mutation.    Returns
 Path

   classSquare(pad=0.3)[source]

Bases: matplotlib.patches.BoxStyle._Base A square box.  Parameters

padfloat, default: 0.3

The amount of padding around the original box.       __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]

Given the location and size of the box, return the path of the box around it.  Parameters

x0, y0, width, heightfloat

Location and size of the box.
mutation_sizefloat

A reference scale for the mutation.    Returns
 Path

  Examples using matplotlib.patches.BoxStyle

   Reference for Matplotlib artists


classCircle(pad=0.3)[source]

Bases: matplotlib.patches.BoxStyle._Base A circular box.  Parameters

padfloat, default: 0.3

The amount of padding around the original box.       __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]

Given the location and size of the box, return the path of the box around it.  Parameters

x0, y0, width, heightfloat

Location and size of the box.
mutation_sizefloat

A reference scale for the mutation.    Returns
 Path


__call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]

Given the location and size of the box, return the path of the box around it.  Parameters

x0, y0, width, heightfloat

Location and size of the box.
mutation_sizefloat

A reference scale for the mutation.    Returns
 Path


classDArrow(pad=0.3)[source]

Bases: matplotlib.patches.BoxStyle._Base A box in the shape of a two-way arrow.  Parameters

padfloat, default: 0.3

The amount of padding around the original box.       __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]

Given the location and size of the box, return the path of the box around it.  Parameters

x0, y0, width, heightfloat

Location and size of the box.
mutation_sizefloat

A reference scale for the mutation.    Returns
 Path


classLArrow(pad=0.3)[source]

Bases: matplotlib.patches.BoxStyle._Base A box in the shape of a left-pointing arrow.  Parameters

padfloat, default: 0.3

The amount of padding around the original box.       __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]

Given the location and size of the box, return the path of the box around it.  Parameters

x0, y0, width, heightfloat

Location and size of the box.
mutation_sizefloat

A reference scale for the mutation.    Returns
 Path


classRArrow(pad=0.3)[source]

Bases: matplotlib.patches.BoxStyle.LArrow A box in the shape of a right-pointing arrow.  Parameters

padfloat, default: 0.3

The amount of padding around the original box.       __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]

Given the location and size of the box, return the path of the box around it.  Parameters

x0, y0, width, heightfloat

Location and size of the box.
mutation_sizefloat

A reference scale for the mutation.    Returns
 Path


classRound(pad=0.3, rounding_size=None)[source]

Bases: matplotlib.patches.BoxStyle._Base A box with round corners.  Parameters

padfloat, default: 0.3

The amount of padding around the original box.
rounding_sizefloat, default: pad

Radius of the corners.       __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]

Given the location and size of the box, return the path of the box around it.  Parameters

x0, y0, width, heightfloat

Location and size of the box.
mutation_sizefloat

A reference scale for the mutation.    Returns
 Path


classRound4(pad=0.3, rounding_size=None)[source]

Bases: matplotlib.patches.BoxStyle._Base A box with rounded edges.  Parameters

padfloat, default: 0.3

The amount of padding around the original box.
rounding_sizefloat, default: pad/2

Rounding of edges.       __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]

Given the location and size of the box, return the path of the box around it.  Parameters

x0, y0, width, heightfloat

Location and size of the box.
mutation_sizefloat

A reference scale for the mutation.    Returns
 Path


classRoundtooth(pad=0.3, tooth_size=None)[source]

Bases: matplotlib.patches.BoxStyle.Sawtooth A box with a rounded sawtooth outline.  Parameters

padfloat, default: 0.3

The amount of padding around the original box.
tooth_sizefloat, default: pad/2

Size of the sawtooth.       __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]

Given the location and size of the box, return the path of the box around it.  Parameters

x0, y0, width, heightfloat

Location and size of the box.
mutation_sizefloat

A reference scale for the mutation.    Returns
 Path


classSawtooth(pad=0.3, tooth_size=None)[source]

Bases: matplotlib.patches.BoxStyle._Base A box with a sawtooth outline.  Parameters

padfloat, default: 0.3

The amount of padding around the original box.
tooth_sizefloat, default: pad/2

Size of the sawtooth.       __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]

Given the location and size of the box, return the path of the box around it.  Parameters

x0, y0, width, heightfloat

Location and size of the box.
mutation_sizefloat

A reference scale for the mutation.    Returns
 Path


classSquare(pad=0.3)[source]

Bases: matplotlib.patches.BoxStyle._Base A square box.  Parameters

padfloat, default: 0.3

The amount of padding around the original box.       __call__(x0, y0, width, height, mutation_size, mutation_aspect=<deprecated parameter>)[source]

Given the location and size of the box, return the path of the box around it.  Parameters

x0, y0, width, heightfloat

Location and size of the box.
mutation_sizefloat

A reference scale for the mutation.    Returns
 Path


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

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     get_radius()[source]

Return the radius of the circle.
   propertyradius

Return the radius of the circle.
   set(*, agg_filter=<UNSET>, alpha=<UNSET>, angle=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, capstyle=<UNSET>, center=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, height=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, 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
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_radius(radius)[source]

Set the radius of the circle.  Parameters

radiusfloat

  Examples using matplotlib.patches.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


get_radius()[source]

Return the radius of the circle.


set(*, agg_filter=<UNSET>, alpha=<UNSET>, angle=<UNSET>, animated=<UNSET>, antialiased=<UNSET>, capstyle=<UNSET>, center=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, color=<UNSET>, edgecolor=<UNSET>, facecolor=<UNSET>, fill=<UNSET>, gid=<UNSET>, hatch=<UNSET>, height=<UNSET>, in_layout=<UNSET>, joinstyle=<UNSET>, label=<UNSET>, linestyle=<UNSET>, linewidth=<UNSET>, 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
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_radius(radius)[source]

Set the radius of the circle.  Parameters

radiusfloat