Make a violin plot.
Make a violin plot for each column of dataset or each vector in sequence dataset. Each filled area extends to represent the entire data range, with optional lines at the mean, the median, the minimum, the maximum, and user-specified quantiles.
The input data.
The positions of the violins. The ticks and limits are automatically set to match the positions.
If true, creates a vertical violin plot. Otherwise, creates a horizontal violin plot.
Either a scalar or a vector that sets the maximal width of each violin. The default is 0.5, which uses about half of the available horizontal space.
If True, will toggle rendering of the means.
If True, will toggle rendering of the extrema.
If True, will toggle rendering of the medians.
If not None, set a list of floats in interval [0, 1] for each violin, which stands for the quantiles that will be rendered for that violin.
Defines the number of points to evaluate each of the gaussian kernel density estimations at.
The method used to calculate the estimator bandwidth. This can be 'scott', 'silverman', a scalar constant or a callable. If a scalar, this will be used directly as kde.factor. If a callable, it should take a GaussianKDE instance as its only parameter and return a scalar. If None (default), 'scott' is used.
If given, the following parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception):
dataset
A dictionary mapping each component of the violinplot to a list of the corresponding collection instances created. The dictionary has the following keys:
Violin plot customization
violinplot(D)


Plot vertical lines at each x from ymin to ymax.
x-indexes where to plot the lines.
Respective beginning and end of each line. If scalars are provided, all lines will have same length.
If given, the following parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception):
x, ymin, ymax, colors
See also
horizontal lines
vertical line across the Axes
Creating a timeline with lines, dates, and text
hlines and vlines
Violin plot customization


Set up axis ticks and labels to treat data along the xaxis as dates.
The timezone used to create date labels.


Return whether the xaxis is oriented in the "inverse" direction.
The "normal" direction is increasing to the right for the x-axis and to the top for the y-axis; the "inverse" direction is increasing to the left for the x-axis and to the bottom for the y-axis.


Plot the cross correlation between x and y.
The correlation with lag k is defined as \(\sum_n x[n+k] \cdot y^*[n]\), where \(y^*\) is the complex conjugate of \(y\).
A detrending function applied to x and y. It must have the signature
If True, input vectors are normalised to unit length.
Determines the plot style.
If True, vertical lines are plotted from 0 to the xcorr value using Axes.vlines. Additionally, a horizontal line is plotted at y=0 using Axes.axhline.
If False, markers are plotted at the xcorr values using Axes.plot.
Number of lags to show. If None, will return all 2 * len(x) - 1 lags.
The lag vector.
The auto correlation vector.
Artist added to the Axes of the correlation:
Horizontal line at 0 if usevlines is True None usevlines is False.
The linestyle for plotting the data points. Only used if usevlines is False.
The marker for plotting the data points. Only used if usevlines is False.
If given, the following parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception):
x, y
Additional parameters are passed to Axes.vlines and Axes.axhline if usevlines is True; otherwise they are passed to Axes.plot.
The cross correlation is performed with numpy.correlate with mode = "full".
Cross- and Auto-Correlation Demo


Set up axis ticks and labels to treat data along the yaxis as dates.
The timezone used to create date labels.


Return whether the yaxis is oriented in the "inverse" direction.
The "normal" direction is increasing to the right for the x-axis and to the top for the y-axis; the "inverse" direction is increasing to the left for the x-axis and to the bottom for the y-axis.


Bases: object
Base class for subplots, which are Axes instances with additional methods to facilitate generating and manipulating a set of Axes within a figure.
The array of subplots in the figure has dimensions (nrows,
ncols), and index is the index of the subplot being created. index starts at 1 in the upper left corner and increases to the right.
If nrows, ncols, and index are all single digit numbers, then args can be passed as a single 3-digit number (e.g. 234 for (2, 3, 4)).
Keyword arguments are passed to the Axes (sub)class constructor.
[Deprecated] Change subplot geometry, e.g., from (1, 1, 1) to (2, 2, 3).
Deprecated since version 3.4.
[Deprecated] Get the subplot geometry, e.g., (2, 2, 3).
Deprecated since version 3.4.
Return the GridSpec instance associated with the subplot.
Return the SubplotSpec instance associated with the subplot.
[Deprecated]
Deprecated since version 3.4:
[Deprecated]
Deprecated since version 3.4:
[Deprecated]
Deprecated since version 3.4:
[Deprecated]
Deprecated since version 3.4:
Only show "outer" labels and tick labels.
x-labels are only kept for subplots on the last row (or first row, if labels are on the top side); y-labels only for subplots on the first column (or last column, if labels are on the right side).
Set the SubplotSpec. instance associated with the subplot.
[Deprecated] Update the subplot position from self.figure.subplotpars.
Deprecated since version 3.4.


[Deprecated] Change subplot geometry, e.g., from (1, 1, 1) to (2, 2, 3).
Deprecated since version 3.4.


[Deprecated] Get the subplot geometry, e.g., (2, 2, 3).
Deprecated since version 3.4.


Return the GridSpec instance associated with the subplot.


Return the SubplotSpec instance associated with the subplot.


[Deprecated]
Deprecated since version 3.4:


Only show "outer" labels and tick labels.
x-labels are only kept for subplots on the last row (or first row, if labels are on the top side); y-labels only for subplots on the first column (or last column, if labels are on the right side).


Set the SubplotSpec. instance associated with the subplot.


[Deprecated] Update the subplot position from self.figure.subplotpars.
Deprecated since version 3.4.


Note
AxesGrid has been a part of matplotlib since v 0.99. Originally, the toolkit used the axes_grid namespace. In more recent versions, the toolkit has been split into axes_grid1 and axisartist. While axes_grid is maintained for the backward compatibility, use of axes_grid1 and axisartist is recommended. For the documentation on axes_grid, see the previous version of the docs.


mpl_toolkits.axes_grid1 provides a framework of helper classes to adjust the positioning of multiple fixed-aspect Axes (e.g., displaying images). It can be contrasted with the aspect property of Matplotlib Axes, which adjusts the position of a single Axes.
See Overview of mpl_toolkits.axes_grid1 for a guide on the usage of axes_grid1.
The submodules of the axes_grid1 API are:
axes_grid1.anchored_artists
axes_grid1.axes_divider
Helper classes to adjust the positions of multiple axes at drawing time.
axes_grid1.axes_grid
axes_grid1.axes_rgb
axes_grid1.axes_size
Provides classes of simple units that will be used with AxesDivider class (or others) to determine the size of each axes.
axes_grid1.inset_locator
A collection of functions and objects for creating or placing inset axes.
axes_grid1.mpl_axes
axes_grid1.parasite_axes


AnchoredAuxTransformBox(transform, loc[, ...])
An anchored container with transformed coordinates.
AnchoredDirectionArrows(transform, label_x, ...)
Draw two perpendicular arrows to indicate directions.
AnchoredDrawingArea(width, height, xdescent, ...)
An anchored container with a fixed size and fillable DrawingArea.
AnchoredEllipse(transform, width, height, ...)
Draw an anchored ellipse of a given size.
AnchoredSizeBar(transform, size, label, loc)
Draw a horizontal scale bar with a center-aligned label underneath.


Bases: matplotlib.offsetbox.AnchoredOffsetbox
An anchored container with transformed coordinates.
Artists added to the drawing_area are scaled according to the coordinates of the transformation used. The dimensions of this artist will scale to contain the artists added.
The transformation object for the coordinate system in use, i.e., matplotlib.axes.Axes.transData.
Location of this artist. Valid locations are 'upper left', 'upper center', 'upper right', 'center left', 'center', 'center right', 'lower left', 'lower center, 'lower right'. For backward compatibility, numeric values are accepted as well. See the parameter loc of Legend for details.
Padding around the child objects, in fraction of the font size.
Border padding, in fraction of the font size.
Font property used as a reference for paddings.
If True, draw a box around this artists.
Keyword arguments forwarded to AnchoredOffsetbox.
To display an ellipse in the upper left, with a width of 0.1 and height of 0.4 in data coordinates:
A container for artists to display.
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
bbox_to_anchor
unknown
child
unknown
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
Annotations


Set multiple properties at once.
Supported properties are
Property
Description
agg_filter
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha
scalar or None
animated
bool
bbox_to_anchor
unknown
child
unknown
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


Bases: matplotlib.offsetbox.AnchoredOffsetbox
Draw two perpendicular arrows to indicate directions.
The transformation object for the coordinate system in use, i.e., matplotlib.axes.Axes.transAxes.
Label text for the x and y arrows
Length of the arrow, given in coordinates of transform.
Size of label strings, given in coordinates of transform.
Location of this ellipse. Valid locations are 'upper left', 'upper center', 'upper right', 'center left', 'center', 'center right', 'lower left', 'lower center, 'lower right'. For backward compatibility, numeric values are accepted as well. See the parameter loc of Legend for details.
The angle of the arrows in degrees.
The ratio of the length of arrow_x and arrow_y. Negative numbers can be used to change the direction.
Padding around the labels and arrows, in fraction of the font size.
Border padding, in fraction of the font size.
If True, draw a box around the arrows and labels.
Color for the arrows and labels.
Alpha values of the arrows and labels
Separation between the arrows and labels in coordinates of transform.
Font properties for the label text.
Fraction of the arrow behind the arrow crossing.
Width of arrow head, sent to ArrowStyle.
Length of arrow head, sent to ArrowStyle.
Width of arrow tail, sent to ArrowStyle.
Properties of the text and arrows, passed to textpath.TextPath and patches.FancyArrowPatch.
Keyword arguments forwarded to AnchoredOffsetbox.
If prop is passed as a keyword argument, but fontproperties is not, then prop is be assumed to be the intended fontproperties. Using both prop and fontproperties is not supported.
Using several of the optional parameters, creating downward pointing arrow and high contrast text labels.
Arrow x and y
Path for arrow labels
Patch for arrow labels
Container for the arrows and labels.
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
bbox_to_anchor
unknown
child
unknown
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
Anchored Direction Arrow


Bases: matplotlib.offsetbox.AnchoredOffsetbox
An anchored container with a fixed size and fillable DrawingArea.
Artists added to the drawing_area will have their coordinates interpreted as pixels. Any transformations set on the artists will be overridden.
width and height of the container, in pixels.
descent of the container in the x- and y- direction, in pixels.
Location of this artist. Valid locations are 'upper left', 'upper center', 'upper right', 'center left', 'center', 'center right', 'lower left', 'lower center, 'lower right'. For backward compatibility, numeric values are accepted as well. See the parameter loc of Legend for details.
Padding around the child objects, in fraction of the font size.
Border padding, in fraction of the font size.
Font property used as a reference for paddings.
If True, draw a box around this artists.
Keyword arguments forwarded to AnchoredOffsetbox.
To display blue and red circles of different sizes in the upper right of an axes ax:
A container for artists to display.
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
bbox_to_anchor
unknown
child
unknown
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
Simple Anchored Artists
Annotations


Bases: matplotlib.offsetbox.AnchoredOffsetbox
Draw an anchored ellipse of a given size.
The transformation object for the coordinate system in use, i.e., matplotlib.axes.Axes.transData.
Width and height of the ellipse, given in coordinates of transform.
Rotation of the ellipse, in degrees, anti-clockwise.
Location of this ellipse. Valid locations are 'upper left', 'upper center', 'upper right', 'center left', 'center', 'center right', 'lower left', 'lower center, 'lower right'. For backward compatibility, numeric values are accepted as well. See the parameter loc of Legend for details.
Padding around the ellipse, in fraction of the font size.
Border padding, in fraction of the font size.
If True, draw a box around the ellipse.
Font property used as a reference for paddings.
Keyword arguments forwarded to AnchoredOffsetbox.
Ellipse patch drawn.
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
bbox_to_anchor
unknown
child
unknown
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
Simple Anchored Artists


Bases: matplotlib.offsetbox.AnchoredOffsetbox
Draw a horizontal scale bar with a center-aligned label underneath.
The transformation object for the coordinate system in use, i.e., matplotlib.axes.Axes.transData.
Horizontal length of the size bar, given in coordinates of transform.
Label to display.
Location of this ellipse. Valid locations are 'upper left', 'upper center', 'upper right', 'center left', 'center', 'center right', 'lower left', 'lower center, 'lower right'. For backward compatibility, numeric values are accepted as well. See the parameter loc of Legend for details.
Padding around the label and size bar, in fraction of the font size.
Border padding, in fraction of the font size.
Separation between the label and the size bar, in points.
If True, draw a box around the horizontal bar and label.
Vertical length of the size bar, given in coordinates of transform.
Color for the size bar and label.
If True, the label will be over the size bar.
Font properties for the label text.
If True and if size_vertical is nonzero, the size bar will be filled in with the color specified by the size bar. Defaults to True if size_vertical is greater than zero and False otherwise.
Keyword arguments forwarded to AnchoredOffsetbox.
If prop is passed as a keyword argument, but fontproperties is not, then prop is be assumed to be the intended fontproperties. Using both prop and fontproperties is not supported.
Using all the optional parameters
Container for the size bar.
Container for the label of the size bar.
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
bbox_to_anchor
unknown
child
unknown
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
Inset Locator Demo2
Simple Anchored Artists


Helper classes to adjust the positions of multiple axes at drawing time.
AxesDivider(axes[, xref, yref])
Divider based on the pre-existing axes.
AxesLocator(axes_divider, nx, ny[, nx1, ny1])
A callable object which returns the position and size of a given AxesDivider cell.
Divider(fig, pos, horizontal, vertical[, ...])
An Axes positioning class.
HBoxDivider(fig, *args[, horizontal, ...])
A SubplotDivider for laying out axes horizontally, while ensuring that they have equal heights.
SubplotDivider(fig, *args[, horizontal, ...])
The Divider class whose rectangle area is specified as a subplot geometry.
VBoxDivider(fig, *args[, horizontal, ...])
A SubplotDivider for laying out axes vertically, while ensuring that they have equal widths.
make_axes_area_auto_adjustable(ax[, ...])
make_axes_locatable(axes)


Bases: mpl_toolkits.axes_grid1.axes_divider.Divider
Divider based on the pre-existing axes.
Create an axes at the given position with the same height (or width) of the main axes.
["left"|"right"|"bottom"|"top"]
size and pad should be axes_grid.axes_size compatible.
Return the anchor.
Return aspect.
Return the position of the rectangle.
Add a new axes on the right (or left) side of the main axes.
The axes width. float or str arguments are interpreted as axes_size.from_any(size, AxesX(<main_axes>)).
Padding between the axes. float or str arguments are interpreted as axes_size.from_any(size, AxesX(<main_axes>)). Defaults to rcParams["figure.subplot.wspace"] (default: 0.2) times the main axes width.
If False, the new axes is appended at the end of the list, i.e., it became the right-most axes. If True, it is inserted at the start of the list, and becomes the left-most axes.
All extra keywords arguments are passed to the created axes. If axes_class is given, the new axes will be created as an instance of the given class. Otherwise, the same class of the main axes will be used.
Add a new axes on the top (or bottom) side of the main axes.
The axes height. float or str arguments are interpreted as axes_size.from_any(size, AxesY(<main_axes>)).
Padding between the axes. float or str arguments are interpreted as axes_size.from_any(size, AxesY(<main_axes>)). Defaults to rcParams["figure.subplot.hspace"] (default: 0.2) times the main axes height.
If False, the new axes is appended at the end of the list, i.e., it became the right-most axes. If True, it is inserted at the start of the list, and becomes the left-most axes.
All extra keywords arguments are passed to the created axes. If axes_class is given, the new axes will be created as an instance of the given class. Otherwise, the same class of the main axes will be used.
Colorbar with AxesDivider
Make Room For Ylabel Using Axesgrid
Scatter Histogram (Locatable Axes)
Simple Colorbar
Tight Layout guide


Create an axes at the given position with the same height (or width) of the main axes.
["left"|"right"|"bottom"|"top"]
size and pad should be axes_grid.axes_size compatible.


Add a new axes on the right (or left) side of the main axes.
The axes width. float or str arguments are interpreted as axes_size.from_any(size, AxesX(<main_axes>)).
Padding between the axes. float or str arguments are interpreted as axes_size.from_any(size, AxesX(<main_axes>)). Defaults to rcParams["figure.subplot.wspace"] (default: 0.2) times the main axes width.
If False, the new axes is appended at the end of the list, i.e., it became the right-most axes. If True, it is inserted at the start of the list, and becomes the left-most axes.
All extra keywords arguments are passed to the created axes. If axes_class is given, the new axes will be created as an instance of the given class. Otherwise, the same class of the main axes will be used.


Add a new axes on the top (or bottom) side of the main axes.
The axes height. float or str arguments are interpreted as axes_size.from_any(size, AxesY(<main_axes>)).
Padding between the axes. float or str arguments are interpreted as axes_size.from_any(size, AxesY(<main_axes>)). Defaults to rcParams["figure.subplot.hspace"] (default: 0.2) times the main axes height.
If False, the new axes is appended at the end of the list, i.e., it became the right-most axes. If True, it is inserted at the start of the list, and becomes the left-most axes.
All extra keywords arguments are passed to the created axes. If axes_class is given, the new axes will be created as an instance of the given class. Otherwise, the same class of the main axes will be used.


Bases: object
A callable object which returns the position and size of a given AxesDivider cell.
Integers specifying the column-position of the cell. When nx1 is None, a single nx-th column is specified. Otherwise location of columns spanning between nx to nx1 (but excluding nx1-th column) is specified.
Same as nx and nx1, but for row positions.
Call self as a function.


Bases: object
An Axes positioning class.
The divider is initialized with lists of horizontal and vertical sizes (mpl_toolkits.axes_grid1.axes_size) based on which a given rectangular area will be divided.
The new_locator method then creates a callable object that can be used as the axes_locator of the axes.
Position of the rectangle that will be divided.
Sizes for horizontal division.
Sizes for vertical division.
Whether overall rectangular area is reduced so that the relative part of the horizontal and vertical scales have the same scale.
Placement of the reduced rectangle, when aspect is True.
Return the anchor.
Return aspect.
Return horizontal sizes.
Return the position of the rectangle.
Return vertical sizes.
[Deprecated]
Deprecated since version 3.5:
Integers specifying the column-position of the cell. When nx1 is None, a single nx-th column is specified. Otherwise location of columns spanning between nx to nx1 (but excluding nx1-th column) is specified.
Same as nx and nx1, but for row positions.
Return a new AxesLocator for the specified cell.
Integers specifying the column-position of the cell. When nx1 is None, a single nx-th column is specified. Otherwise location of columns spanning between nx to nx1 (but excluding nx1-th column) is specified.
Same as nx and nx1, but for row positions.
Either an (x, y) pair of relative coordinates (0 is left or bottom, 1 is right or top), 'C' (center), or a cardinal direction ('SW', southwest, is bottom left, etc.).
See also
sizes for horizontal division
Set the position of the rectangle.
position of the rectangle that will be divided
sizes for vertical division


[Deprecated]
Deprecated since version 3.5:


Integers specifying the column-position of the cell. When nx1 is None, a single nx-th column is specified. Otherwise location of columns spanning between nx to nx1 (but excluding nx1-th column) is specified.
Same as nx and nx1, but for row positions.


Return a new AxesLocator for the specified cell.
Integers specifying the column-position of the cell. When nx1 is None, a single nx-th column is specified. Otherwise location of columns spanning between nx to nx1 (but excluding nx1-th column) is specified.
Same as nx and nx1, but for row positions.


Either an (x, y) pair of relative coordinates (0 is left or bottom, 1 is right or top), 'C' (center), or a cardinal direction ('SW', southwest, is bottom left, etc.).
See also


Set the position of the rectangle.
position of the rectangle that will be divided


Bases: mpl_toolkits.axes_grid1.axes_divider.SubplotDivider
A SubplotDivider for laying out axes horizontally, while ensuring that they have equal heights.
(Source code, png, pdf)
The array of subplots in the figure has dimensions (nrows,
ncols), and index is the index of the subplot being created. index starts at 1 in the upper left corner and increases to the right.
If nrows, ncols, and index are all single digit numbers, then args can be passed as a single 3-digit number (e.g. 234 for (2, 3, 4)).
Integers specifying the column-position of the cell. When nx1 is None, a single nx-th column is specified. Otherwise location of columns spanning between nx to nx1 (but excluding nx1-th column) is specified.
Same as nx and nx1, but for row positions.
Create a new AxesLocator for the specified cell.
Integers specifying the column-position of the cell. When nx1 is None, a single nx-th column is specified. Otherwise location of columns spanning between nx to nx1 (but excluding nx1-th column) is specified.
HBoxDivider demo


Create a new AxesLocator for the specified cell.
Integers specifying the column-position of the cell. When nx1 is None, a single nx-th column is specified. Otherwise location of columns spanning between nx to nx1 (but excluding nx1-th column) is specified.


Bases: mpl_toolkits.axes_grid1.axes_divider.Divider
The Divider class whose rectangle area is specified as a subplot geometry.
The array of subplots in the figure has dimensions (nrows,
ncols), and index is the index of the subplot being created. index starts at 1 in the upper left corner and increases to the right.
If nrows, ncols, and index are all single digit numbers, then args can be passed as a single 3-digit number (e.g. 234 for (2, 3, 4)).
[Deprecated] Change subplot geometry, e.g., from (1, 1, 1) to (2, 2, 3).
Deprecated since version 3.4.
[Deprecated] Get the subplot geometry, e.g., (2, 2, 3).
Deprecated since version 3.4.
Return the bounds of the subplot box.
Get the SubplotSpec instance.
Set the SubplotSpec instance.
[Deprecated]
Deprecated since version 3.4:


[Deprecated] Change subplot geometry, e.g., from (1, 1, 1) to (2, 2, 3).
Deprecated since version 3.4.


[Deprecated] Get the subplot geometry, e.g., (2, 2, 3).
Deprecated since version 3.4.


[Deprecated]
Deprecated since version 3.4:


Bases: mpl_toolkits.axes_grid1.axes_divider.SubplotDivider
A SubplotDivider for laying out axes vertically, while ensuring that they have equal widths.
The array of subplots in the figure has dimensions (nrows,
ncols), and index is the index of the subplot being created. index starts at 1 in the upper left corner and increases to the right.
If nrows, ncols, and index are all single digit numbers, then args can be passed as a single 3-digit number (e.g. 234 for (2, 3, 4)).
Integers specifying the column-position of the cell. When nx1 is None, a single nx-th column is specified. Otherwise location of columns spanning between nx to nx1 (but excluding nx1-th column) is specified.
Same as nx and nx1, but for row positions.
Create a new AxesLocator for the specified cell.
Integers specifying the row-position of the cell. When ny1 is None, a single ny-th row is specified. Otherwise location of rows spanning between ny to ny1 (but excluding ny1-th row) is specified.


Create a new AxesLocator for the specified cell.
Integers specifying the row-position of the cell. When ny1 is None, a single ny-th row is specified. Otherwise location of rows spanning between ny to ny1 (but excluding ny1-th row) is specified.


AxesGrid
alias of mpl_toolkits.axes_grid1.axes_grid.ImageGrid
CbarAxes(*args, orientation, **kwargs)
[Deprecated]
CbarAxesBase(*args, orientation, **kwargs)
Grid(fig, rect, nrows_ncols[, ngrids, ...])
A grid of Axes.
ImageGrid(fig, rect, nrows_ncols[, ngrids, ...])


Bases: mpl_toolkits.axes_grid1.axes_grid.CbarAxesBase, mpl_toolkits.axes_grid1.mpl_axes.Axes
[Deprecated]
Deprecated since version 3.5:
Build an Axes in a figure.
The Axes is built in the Figure fig.
The Axes is built in the rectangle rect. rect is in Figure coordinates.
The x or y axis is shared with the x or y axis in the input Axes.
Whether the Axes frame is visible.
Set a fixed aspect for the Axes box, i.e. the ratio of height to width. See set_box_aspect for details.
Other optional keyword arguments:
Property
Description
adjustable
{'box', 'datalim'}
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
anchor
(float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...}
animated
bool
aspect
{'auto', 'equal'} or float
autoscale_on
bool
autoscalex_on
bool
autoscaley_on
bool
axes_locator
Callable[[Axes, Renderer], Bbox]
axisbelow
bool or 'line'
box_aspect
float or None
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
facecolor or fc
color
figure
Figure
frame_on
bool
gid
str
in_layout
bool
label
object
navigate
bool
navigate_mode
unknown
path_effects
AbstractPathEffect
picker
None or bool or float or callable
position
[left, bottom, width, height] or Bbox
prop_cycle
unknown
rasterization_zorder
float or None
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
title
str
transform
Transform
url
str
visible
bool
xbound
unknown
xlabel
str
xlim
(bottom: float, top: float)
xmargin
float greater than -0.5
xscale
{"linear", "log", "symlog", "logit", ...} or ScaleBase
xticklabels
unknown
xticks
unknown
ybound
unknown
ylabel
str
ylim
(bottom: float, top: float)
ymargin
float greater than -0.5
yscale
{"linear", "log", "symlog", "logit", ...} or ScaleBase
yticklabels
unknown
yticks
unknown
zorder
float
The new Axes object.
Set multiple properties at once.
Supported properties are
Property
Description
adjustable
{'box', 'datalim'}
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
anchor
(float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...}
animated
bool
aspect
{'auto', 'equal'} or float
autoscale_on
bool
autoscalex_on
bool
autoscaley_on
bool
axes_locator
Callable[[Axes, Renderer], Bbox]
axisbelow
bool or 'line'
box_aspect
float or None
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
facecolor or fc
color
figure
Figure
frame_on
bool
gid
str
in_layout
bool
label
object
navigate
bool
navigate_mode
unknown
path_effects
AbstractPathEffect
picker
None or bool or float or callable
position
[left, bottom, width, height] or Bbox
prop_cycle
unknown
rasterization_zorder
float or None
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
title
str
transform
Transform
url
str
visible
bool
xbound
unknown
xlabel
str
xlim
(bottom: float, top: float)
xmargin
float greater than -0.5
xscale
{"linear", "log", "symlog", "logit", ...} or ScaleBase
xticklabels
unknown
xticks
unknown
ybound
unknown
ylabel
str
ylim
(bottom: float, top: float)
ymargin
float greater than -0.5
yscale
{"linear", "log", "symlog", "logit", ...} or ScaleBase
yticklabels
unknown
yticks
unknown
zorder
float


Set multiple properties at once.
Supported properties are
Property
Description
adjustable
{'box', 'datalim'}
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
anchor
(float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...}
animated
bool
aspect
{'auto', 'equal'} or float
autoscale_on
bool
autoscalex_on
bool
autoscaley_on
bool
axes_locator
Callable[[Axes, Renderer], Bbox]
axisbelow
bool or 'line'
box_aspect
float or None
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
facecolor or fc
color
figure
Figure
frame_on
bool
gid
str
in_layout
bool
label
object
navigate
bool
navigate_mode
unknown
path_effects
AbstractPathEffect
picker
None or bool or float or callable
position
[left, bottom, width, height] or Bbox
prop_cycle
unknown
rasterization_zorder
float or None
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
title
str
transform
Transform
url
str
visible
bool
xbound
unknown
xlabel
str
xlim
(bottom: float, top: float)
xmargin
float greater than -0.5
xscale
{"linear", "log", "symlog", "logit", ...} or ScaleBase
xticklabels
unknown
xticks
unknown
ybound
unknown
ylabel
str
ylim
(bottom: float, top: float)
ymargin
float greater than -0.5
yscale
{"linear", "log", "symlog", "logit", ...} or ScaleBase
yticklabels
unknown
yticks
unknown
zorder
float


Bases: object
A grid of Axes.
In Matplotlib, the axes location (and size) is specified in normalized figure coordinates. This may not be ideal for images that needs to be displayed with a given aspect ratio; for example, it is difficult to display multiple images of a same size with some fixed padding between them. AxesGrid can be used in such case.
The parent figure.
The axes position, as a (left, bottom, width, height) tuple or as a three-digit subplot position code (e.g., "121").
Number of rows and columns in the grid.
If not None, only the first ngrids axes in the grid are created.
Whether axes are created in row-major ("row by row") or column-major order ("column by column"). This also affects the order in which axes are accessed using indexing (grid[index]).
Padding or (horizontal padding, vertical padding) between axes, in inches.
Whether all axes share their x- and y-axis. Overrides share_x and share_y.
Whether all axes of a column share their x-axis.
Whether all axes of a row share their y-axis.
Determines which axes will get tick labels:
Whether the axes aspect ratio follows the aspect ratio of the data limits.
Return the aspect of the SubplotDivider.
Return the axes padding.
Padding (horizontal pad, vertical pad) in inches.
Return the number of rows and columns of the grid as (nrows, ncols).
[Deprecated]
Deprecated since version 3.5:
Set the aspect of the SubplotDivider.
Set the padding between the axes.
The padding (horizontal pad, vertical pad) in inches.
Define which axes have tick labels.
The label mode:


Return the aspect of the SubplotDivider.


Return the axes padding.
Padding (horizontal pad, vertical pad) in inches.


Return the number of rows and columns of the grid as (nrows, ncols).


[Deprecated]
Deprecated since version 3.5:


Set the padding between the axes.
The padding (horizontal pad, vertical pad) in inches.


Define which axes have tick labels.
The label mode:


Bases: mpl_toolkits.axes_grid1.axes_grid.Grid
The parent figure.
The axes position, as a (left, bottom, width, height) tuple or as a three-digit subplot position code (e.g., "121").
Number of rows and columns in the grid.
If not None, only the first ngrids axes in the grid are created.
Whether axes are created in row-major ("row by row") or column-major order ("column by column"). This also affects the order in which axes are accessed using indexing (grid[index]).
Padding or (horizontal padding, vertical padding) between axes, in inches.
Whether all axes share their x- and y-axis.
Whether the axes aspect ratio follows the aspect ratio of the data limits.
Determines which axes will get tick labels:
Whether to create a colorbar for "each" axes, a "single" colorbar for the entire grid, colorbars only for axes on the "edge" determined by cbar_location, or no colorbars. The colorbars are stored in the cbar_axes attribute.
Padding between the image axes and the colorbar axes.
Colorbar size.
If True, each axes in the grid has a cax attribute that is bound to associated cbar_axes.


RGBAxes(*args[, pad])
4-panel imshow (RGB, R, G, B).
make_rgb_axes(ax[, pad, axes_class])


Fraction of the axes height.
Showing RGB channels using RGBAxes


Bases: object
4-panel imshow (RGB, R, G, B).
Layout:
RGB
R
G
B
Subclasses can override the _defaultAxesClass attribute.
The axes object for the three-channel imshow.
The axes object for the red channel imshow.
The axes object for the green channel imshow.
The axes object for the blue channel imshow.
fraction of the axes height to put as padding.
Unpacked into axes_class() init for RGB
Unpacked into axes_class() init for RGB, R, G, B axes
Create the four images {rgb, r, g, b}.
The red, green, and blue arrays.
kwargs get unpacked into the imshow calls for the four images.
Showing RGB channels using RGBAxes


Create the four images {rgb, r, g, b}.
The red, green, and blue arrays.
kwargs get unpacked into the imshow calls for the four images.


Provides classes of simple units that will be used with AxesDivider class (or others) to determine the size of each axes. The unit classes define get_size method that returns a tuple of two floats, meaning relative and absolute sizes, respectively.
Note that this class is nothing more than a simple tuple of two floats. Take a look at the Divider class to see how these two values are used.
Add(a, b)
AddList(add_list)
AxesX(axes[, aspect, ref_ax])
Scaled size whose relative part corresponds to the data width of the axes multiplied by the aspect.
AxesY(axes[, aspect, ref_ax])
Scaled size whose relative part corresponds to the data height of the axes multiplied by the aspect.
Fixed(fixed_size)
Simple fixed size with absolute part = fixed_size and relative part = 0.
Fraction(fraction, ref_size)
An instance whose size is a fraction of the ref_size.
GetExtentHelper(ax, direction)
MaxExtent(artist_list, w_or_h)
Size whose absolute part is either the largest width or the largest height of the given artist_list.
MaxHeight(artist_list)
Size whose absolute part is the largest height of the given artist_list.
MaxWidth(artist_list)
Size whose absolute part is the largest width of the given artist_list.
Padded(size, pad)
Return a instance where the absolute part of size is increase by the amount of pad.
Scalable
alias of mpl_toolkits.axes_grid1.axes_size.Scaled
Scaled(scalable_size)
Simple scaled(?) size with absolute part = 0 and relative part = scalable_size.
SizeFromFunc(func)
from_any(size[, fraction_ref])
Create a Fixed unit when the first argument is a float, or a Fraction unit if that is a string that ends with %.


Bases: mpl_toolkits.axes_grid1.axes_size._Base
Scaled size whose relative part corresponds to the data width of the axes multiplied by the aspect.
HBoxDivider demo
Simple Axes Divider 3


Bases: mpl_toolkits.axes_grid1.axes_size._Base
Scaled size whose relative part corresponds to the data height of the axes multiplied by the aspect.
HBoxDivider demo
Simple Axes Divider 3


Bases: mpl_toolkits.axes_grid1.axes_size._Base
Simple fixed size with absolute part = fixed_size and relative part = 0.
HBoxDivider demo
Axes with a fixed physical size
Simple Axes Divider 1
Simple Axes Divider 3


Bases: mpl_toolkits.axes_grid1.axes_size._Base
An instance whose size is a fraction of the ref_size.


Create a Fixed unit when the first argument is a float, or a Fraction unit if that is a string that ends with %. The second argument is only meaningful when Fraction unit is created.


Bases: mpl_toolkits.axes_grid1.axes_size._Base
Size whose absolute part is either the largest width or the largest height of the given artist_list.


Bases: mpl_toolkits.axes_grid1.axes_size.MaxExtent
Size whose absolute part is the largest height of the given artist_list.


Bases: mpl_toolkits.axes_grid1.axes_size.MaxExtent
Size whose absolute part is the largest width of the given artist_list.


Bases: mpl_toolkits.axes_grid1.axes_size._Base
Return a instance where the absolute part of size is increase by the amount of pad.


Bases: mpl_toolkits.axes_grid1.axes_size._Base
Simple scaled(?) size with absolute part = 0 and relative part = scalable_size.
HBoxDivider demo
Axes with a fixed physical size
Simple Axes Divider 1


A collection of functions and objects for creating or placing inset axes.
AnchoredLocatorBase(bbox_to_anchor, ...[, ...])
AnchoredSizeLocator(bbox_to_anchor, x_size, ...)
AnchoredZoomLocator(parent_axes, zoom, loc)
BboxConnector(bbox1, bbox2, loc1[, loc2])
Connect two bboxes with a straight line.
BboxConnectorPatch(bbox1, bbox2, loc1a, ...)
Connect two bboxes with a quadrilateral.
BboxPatch(bbox, **kwargs)
Patch showing the shape bounded by a Bbox.
InsetPosition(parent, lbwh)
An object for positioning an inset axes.
inset_axes(parent_axes, width, height[, ...])
Create an inset axes with a given width and height.
mark_inset(parent_axes, inset_axes, loc1, ...)
Draw a box to mark the location of an area represented by an inset axes.
zoomed_inset_axes(parent_axes, zoom[, loc, ...])
Create an anchored inset axes by scaling a parent axes.


Bases: matplotlib.offsetbox.AnchoredOffsetbox
The box location. Valid locations are 'upper left', 'upper center', 'upper right', 'center left', 'center', 'center right', 'lower left', 'lower center, 'lower right'. For backward compatibility, numeric values are accepted as well. See the parameter loc of Legend for details.
Padding around the child as fraction of the fontsize.
Padding between the offsetbox frame and the bbox_to_anchor.
The box that will be anchored.
This is only used as a reference for paddings. If not given, rcParams["legend.fontsize"] (default: 'medium') is used.
Whether to draw a frame around the box.
Box that is used to position the legend in conjunction with loc.
The transform for the bounding box (bbox_to_anchor).
All other parameters are passed on to OffsetBox.
See Legend for a detailed description of the anchoring mechanism.
Call self as a function.
Update the location of children if necessary and draw them to the given renderer.
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
bbox_to_anchor
unknown
child
unknown
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 the location of children if necessary and draw them to the given renderer.


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
bbox_to_anchor
unknown
child
unknown
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


Bases: mpl_toolkits.axes_grid1.inset_locator.AnchoredLocatorBase
The box location. Valid locations are 'upper left', 'upper center', 'upper right', 'center left', 'center', 'center right', 'lower left', 'lower center, 'lower right'. For backward compatibility, numeric values are accepted as well. See the parameter loc of Legend for details.
Padding around the child as fraction of the fontsize.
Padding between the offsetbox frame and the bbox_to_anchor.
The box that will be anchored.
This is only used as a reference for paddings. If not given, rcParams["legend.fontsize"] (default: 'medium') is used.
Whether to draw a frame around the box.
Box that is used to position the legend in conjunction with loc.
The transform for the bounding box (bbox_to_anchor).
All other parameters are passed on to OffsetBox.
See Legend for a detailed description of the anchoring mechanism.
Return the extent of the box as (width, height, x, y).
This is the extent of the child plus the padding.
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
bbox_to_anchor
unknown
child
unknown
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


Return the extent of the box as (width, height, x, y).
This is the extent of the child plus the padding.


Bases: matplotlib.patches.Patch
Connect two bboxes with a straight line.
Bounding boxes to connect.
Corner of bbox1 to draw the line. Valid values are:
Corner of bbox2 to draw the line. If None, defaults to loc1. Valid values are:
Patch properties for the line drawn. Valid arguments include:
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
Helper function to obtain a Path from one bbox to another.
Bounding boxes to connect.
Corner of bbox1 to use. Valid values are:
Corner of bbox2 to use. If None, defaults to loc1. Valid values are:
A line segment from the loc1 corner of bbox1 to the loc2 corner of bbox2.
Helper function to obtain the location of a corner of a bbox
Corner of bbox. Valid values are:
Coordinates of the corner specified by loc.
Return the path of this patch.
Set multiple properties at once.
Supported properties are
Property
Description
agg_filter
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha
scalar or None
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
color
color
edgecolor or ec
color or None
facecolor or fc
color or None
figure
Figure
fill
bool
gid
str
hatch
{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout
bool
joinstyle
JoinStyle or {'miter', 'round', 'bevel'}
label
object
linestyle or ls
{'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw
float or None
path_effects
AbstractPathEffect
picker
None or bool or float or callable
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
transform
Transform
url
str
visible
bool
zorder
float
Axes Zoom Effect


Helper function to obtain a Path from one bbox to another.
Bounding boxes to connect.
Corner of bbox1 to use. Valid values are:
Corner of bbox2 to use. If None, defaults to loc1. Valid values are:
A line segment from the loc1 corner of bbox1 to the loc2 corner of bbox2.


Helper function to obtain the location of a corner of a bbox
Corner of bbox. Valid values are:
Coordinates of the corner specified by loc.


Set multiple properties at once.
Supported properties are
Property
Description
agg_filter
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha
scalar or None
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
color
color
edgecolor or ec
color or None
facecolor or fc
color or None
figure
Figure
fill
bool
gid
str
hatch
{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout
bool
joinstyle
JoinStyle or {'miter', 'round', 'bevel'}
label
object
linestyle or ls
{'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw
float or None
path_effects
AbstractPathEffect
picker
None or bool or float or callable
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
transform
Transform
url
str
visible
bool
zorder
float


Bases: mpl_toolkits.axes_grid1.inset_locator.BboxConnector
Connect two bboxes with a quadrilateral.
The quadrilateral is specified by two lines that start and end at corners of the bboxes. The four sides of the quadrilateral are defined by the two lines given, the line between the two corners specified in bbox1 and the line between the two corners specified in bbox2.
Bounding boxes to connect.
Corners of bbox1 and bbox2 to draw the first line. Valid values are:
Corners of bbox1 and bbox2 to draw the second line. Valid values are:
Patch properties for the line drawn:
Property
Description
agg_filter
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha
unknown
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
color
color
edgecolor or ec
color or None
facecolor or fc
color or None
figure
Figure
fill
bool
gid
str
hatch
{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout
bool
joinstyle
JoinStyle or {'miter', 'round', 'bevel'}
label
object
linestyle or ls
{'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw
float or None
path_effects
AbstractPathEffect
picker
None or bool or float or callable
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
transform
Transform
url
str
visible
bool
zorder
float
Return the path of this patch.
Set multiple properties at once.
Supported properties are
Property
Description
agg_filter
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha
scalar or None
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
color
color
edgecolor or ec
color or None
facecolor or fc
color or None
figure
Figure
fill
bool
gid
str
hatch
{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout
bool
joinstyle
JoinStyle or {'miter', 'round', 'bevel'}
label
object
linestyle or ls
{'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw
float or None
path_effects
AbstractPathEffect
picker
None or bool or float or callable
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
transform
Transform
url
str
visible
bool
zorder
float
Axes Zoom Effect


Bases: matplotlib.patches.Patch
Patch showing the shape bounded by a Bbox.
Bbox to use for the extents of this patch.
Patch properties. Valid arguments include:
Property
Description
agg_filter
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha
unknown
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
color
color
edgecolor or ec
color or None
facecolor or fc
color or None
figure
Figure
fill
bool
gid
str
hatch
{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout
bool
joinstyle
JoinStyle or {'miter', 'round', 'bevel'}
label
object
linestyle or ls
{'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw
float or None
path_effects
AbstractPathEffect
picker
None or bool or float or callable
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
transform
Transform
url
str
visible
bool
zorder
float
Return the path of this patch.
Set multiple properties at once.
Supported properties are
Property
Description
agg_filter
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha
scalar or None
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
color
color
edgecolor or ec
color or None
facecolor or fc
color or None
figure
Figure
fill
bool
gid
str
hatch
{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout
bool
joinstyle
JoinStyle or {'miter', 'round', 'bevel'}
label
object
linestyle or ls
{'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw
float or None
path_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
Axes Zoom Effect


Create an inset axes with a given width and height.
Both sizes used can be specified either in inches or percentage. For example,:
creates in inset axes in the lower left corner of parent_axes which spans over 30% in height and 40% in width of the parent_axes. Since the usage of inset_axes may become slightly tricky when exceeding such standard cases, it is recommended to read the examples.
Axes to place the inset axes.
Size of the inset axes to create. If a float is provided, it is the size in inches, e.g. width=1.3. If a string is provided, it is the size in relative units, e.g. width='40%'. By default, i.e. if neither bbox_to_anchor nor bbox_transform are specified, those are relative to the parent_axes. Otherwise they are to be understood relative to the bounding box provided via bbox_to_anchor.
Location to place the inset axes. Valid locations are 'upper left', 'upper center', 'upper right', 'center left', 'center', 'center right', 'lower left', 'lower center, 'lower right'. For backward compatibility, numeric values are accepted as well. See the parameter loc of Legend for details.
Bbox that the inset axes will be anchored to. If None, a tuple of (0, 0, 1, 1) is used if bbox_transform is set to parent_axes.transAxes or parent_axes.figure.transFigure. Otherwise, parent_axes.bbox is used. If a tuple, can be either [left, bottom, width, height], or [left, bottom]. If the kwargs width and/or height are specified in relative units, the 2-tuple [left, bottom] cannot be used. Note that, unless bbox_transform is set, the units of the bounding box are interpreted in the pixel coordinate. When using bbox_to_anchor with tuple, it almost always makes sense to also specify a bbox_transform. This might often be the axes transform parent_axes.transAxes.
Transformation for the bbox that contains the inset axes. If None, a transforms.IdentityTransform is used. The value of bbox_to_anchor (or the return value of its get_points method) is transformed by the bbox_transform and then interpreted as points in the pixel coordinate (which is dpi dependent). You may provide bbox_to_anchor in some normalized coordinate, and give an appropriate transform (e.g., parent_axes.transAxes).
The type of the newly created inset axes.
Keyword arguments to pass to the constructor of the inset axes. Valid arguments include:
Property
Description
adjustable
{'box', 'datalim'}
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
anchor
(float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...}
animated
bool
aspect
{'auto', 'equal'} or float
autoscale_on
bool
autoscalex_on
bool
autoscaley_on
bool
axes_locator
Callable[[Axes, Renderer], Bbox]
axisbelow
bool or 'line'
box_aspect
float or None
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
facecolor or fc
color
figure
Figure
frame_on
bool
gid
str
in_layout
bool
label
object
navigate
bool
navigate_mode
unknown
path_effects
AbstractPathEffect
picker
None or bool or float or callable
position
[left, bottom, width, height] or Bbox
prop_cycle
unknown
rasterization_zorder
float or None
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
title
str
transform
Transform
url
str
visible
bool
xbound
unknown
xlabel
str
xlim
(bottom: float, top: float)
xmargin
float greater than -0.5
xscale
{"linear", "log", "symlog", "logit", ...} or ScaleBase
xticklabels
unknown
xticks
unknown
ybound
unknown
ylabel
str
ylim
(bottom: float, top: float)
ymargin
float greater than -0.5
yscale
{"linear", "log", "symlog", "logit", ...} or ScaleBase
yticklabels
unknown
yticks
unknown
zorder
float
Padding between inset axes and the bbox_to_anchor. The units are axes font size, i.e. for a default font size of 10 points borderpad = 0.5 is equivalent to a padding of 5 points.
Inset axes object created.
The meaning of bbox_to_anchor and bbox_to_transform is interpreted differently from that of legend. The value of bbox_to_anchor (or the return value of its get_points method; the default is parent_axes.bbox) is transformed by the bbox_transform (the default is Identity transform) and then interpreted as points in the pixel coordinate (which is dpi dependent).
Thus, following three calls are identical and creates an inset axes with respect to the parent_axes:
Adding a colorbar to inset axes
Controlling the position and size of colorbars with Inset Axes
Inset Locator Demo


Bases: object
An object for positioning an inset axes.
This is created by specifying the normalized coordinates in the axes, instead of the figure.
Axes to use for normalizing coordinates.
The left edge, bottom edge, width, and height of the inset axes, in units of the normalized coordinate of the parent axes.
See also
The following bounds the inset axes to a box with 20% of the parent axes's height and 40% of the width. The size of the axes specified ([0, 0, 1, 1]) ensures that the axes completely fills the bounding box:
Call self as a function.


Draw a box to mark the location of an area represented by an inset axes.
This function draws a box in parent_axes at the bounding box of inset_axes, and shows a connection with the inset axes by drawing lines at the corners, giving a "zoomed in" effect.
Axes which contains the area of the inset axes.
The inset axes.
Corners to use for connecting the inset axes and the area in the parent axes.
Patch properties for the lines and box drawn:
Property
Description
agg_filter
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha
unknown
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
color
color
edgecolor or ec
color or None
facecolor or fc
color or None
figure
Figure
fill
bool
gid
str
hatch
{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout
bool
joinstyle
JoinStyle or {'miter', 'round', 'bevel'}
label
object
linestyle or ls
{'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw
float or None
path_effects
AbstractPathEffect
picker
None or bool or float or callable
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
transform
Transform
url
str
visible
bool
zorder
float
The patch drawn to represent the area of the inset axes.
The patches connecting two corners of the inset axes and its area.
Inset Locator Demo2


Create an anchored inset axes by scaling a parent axes. For usage, also see the examples.
Axes to place the inset axes.
Scaling factor of the data axes. zoom > 1 will enlarge the coordinates (i.e., "zoomed in"), while zoom < 1 will shrink the coordinates (i.e., "zoomed out").
Location to place the inset axes. Valid locations are 'upper left', 'upper center', 'upper right', 'center left', 'center', 'center right', 'lower left', 'lower center, 'lower right'. For backward compatibility, numeric values are accepted as well. See the parameter loc of Legend for details.
Bbox that the inset axes will be anchored to. If None, parent_axes.bbox is used. If a tuple, can be either [left, bottom, width, height], or [left, bottom]. If the kwargs width and/or height are specified in relative units, the 2-tuple [left, bottom] cannot be used. Note that the units of the bounding box are determined through the transform in use. When using bbox_to_anchor it almost always makes sense to also specify a bbox_transform. This might often be the axes transform parent_axes.transAxes.
Transformation for the bbox that contains the inset axes. If None, a transforms.IdentityTransform is used (i.e. pixel coordinates). This is useful when not providing any argument to bbox_to_anchor. When using bbox_to_anchor it almost always makes sense to also specify a bbox_transform. This might often be the axes transform parent_axes.transAxes. Inversely, when specifying the axes- or figure-transform here, be aware that not specifying bbox_to_anchor will use parent_axes.bbox, the units of which are in display (pixel) coordinates.
The type of the newly created inset axes.
Keyword arguments to pass to the constructor of the inset axes. Valid arguments include:
Property
Description
adjustable
{'box', 'datalim'}
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
anchor
(float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...}
animated
bool
aspect
{'auto', 'equal'} or float
autoscale_on
bool
autoscalex_on
bool
autoscaley_on
bool
axes_locator
Callable[[Axes, Renderer], Bbox]
axisbelow
bool or 'line'
box_aspect
float or None
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
facecolor or fc
color
figure
Figure
frame_on
bool
gid
str
in_layout
bool
label
object
navigate
bool
navigate_mode
unknown
path_effects
AbstractPathEffect
picker
None or bool or float or callable
position
[left, bottom, width, height] or Bbox
prop_cycle
unknown
rasterization_zorder
float or None
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
title
str
transform
Transform
url
str
visible
bool
xbound
unknown
xlabel
str
xlim
(bottom: float, top: float)
xmargin
float greater than -0.5
xscale
{"linear", "log", "symlog", "logit", ...} or ScaleBase
xticklabels
unknown
xticks
unknown
ybound
unknown
ylabel
str
ylim
(bottom: float, top: float)
ymargin
float greater than -0.5
yscale
{"linear", "log", "symlog", "logit", ...} or ScaleBase
yticklabels
unknown
yticks
unknown
zorder
float
Padding between inset axes and the bbox_to_anchor. The units are axes font size, i.e. for a default font size of 10 points borderpad = 0.5 is equivalent to a padding of 5 points.
Inset axes object created.
Adding a colorbar to inset axes
Inset Locator Demo2


Axes(fig, rect, *[, facecolor, frameon, ...])
Build an Axes in a figure.
SimpleAxisArtist(axis, axisnum, spine)
SimpleChainedObjects(objects)


Bases: matplotlib.axes._axes.Axes
Build an Axes in a figure.
The Axes is built in the Figure fig.
The Axes is built in the rectangle rect. rect is in Figure coordinates.
The x or y axis is shared with the x or y axis in the input Axes.
Whether the Axes frame is visible.
Set a fixed aspect for the Axes box, i.e. the ratio of height to width. See set_box_aspect for details.
Other optional keyword arguments:
Property
Description
adjustable
{'box', 'datalim'}
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
anchor
(float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...}
animated
bool
aspect
{'auto', 'equal'} or float
autoscale_on
bool
autoscalex_on
bool
autoscaley_on
bool
axes_locator
Callable[[Axes, Renderer], Bbox]
axisbelow
bool or 'line'
box_aspect
float or None
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
facecolor or fc
color
figure
Figure
frame_on
bool
gid
str
in_layout
bool
label
object
navigate
bool
navigate_mode
unknown
path_effects
AbstractPathEffect
picker
None or bool or float or callable
position
[left, bottom, width, height] or Bbox
prop_cycle
unknown
rasterization_zorder
float or None
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
title
str
transform
Transform
url
str
visible
bool
xbound
unknown
xlabel
str
xlim
(bottom: float, top: float)
xmargin
float greater than -0.5
xscale
{"linear", "log", "symlog", "logit", ...} or ScaleBase
xticklabels
unknown
xticks
unknown
ybound
unknown
ylabel
str
ylim
(bottom: float, top: float)
ymargin
float greater than -0.5
yscale
{"linear", "log", "symlog", "logit", ...} or ScaleBase
yticklabels
unknown
yticks
unknown
zorder
float
The new Axes object.
Bases: dict
Call self as a function.
Convenience method to get or set some axis properties.
Call signatures:
The axis limits to be set. This can also be achieved using
If a bool, turns axis lines and labels on or off. If a string, possible values are:
Value
Description
'on'
Turn on axis lines and labels. Same as True.
'off'
Turn off axis lines and labels. Same as False.
'equal'
Set equal scaling (i.e., make circles circular) by changing axis limits. This is the same as ax.set_aspect('equal', adjustable='datalim'). Explicit data limits may not be respected in this case.
'scaled'
Set equal scaling (i.e., make circles circular) by changing dimensions of the plot box. This is the same as ax.set_aspect('equal', adjustable='box', anchor='C'). Additionally, further autoscaling will be disabled.
'tight'
Set limits just large enough to show all data, then disable further autoscaling.
'auto'
Automatic scaling (fill plot box with data).
'image'
'scaled' with axis limits equal to data limits.
'square'
Square plot; similar to 'scaled', but initially forcing xmax-xmin == ymax-ymin.
Whether observers are notified of the axis limit change. This option is passed on to set_xlim and set_ylim.
The axis limits.
See also
Clear the Axes.
Set multiple properties at once.
Supported properties are
Property
Description
adjustable
{'box', 'datalim'}
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
anchor
(float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...}
animated
bool
aspect
{'auto', 'equal'} or float
autoscale_on
bool
autoscalex_on
bool
autoscaley_on
bool
axes_locator
Callable[[Axes, Renderer], Bbox]
axisbelow
bool or 'line'
box_aspect
float or None
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
facecolor or fc
color
figure
Figure
frame_on
bool
gid
str
in_layout
bool
label
object
navigate
bool
navigate_mode
unknown
path_effects
AbstractPathEffect
picker
None or bool or float or callable
position
[left, bottom, width, height] or Bbox
prop_cycle
unknown
rasterization_zorder
float or None
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
title
str
transform
Transform
url
str
visible
bool
xbound
unknown
xlabel
str
xlim
(bottom: float, top: float)
xmargin
float greater than -0.5
xscale
{"linear", "log", "symlog", "logit", ...} or ScaleBase
xticklabels
unknown
xticks
unknown
ybound
unknown
ylabel
str
ylim
(bottom: float, top: float)
ymargin
float greater than -0.5
yscale
{"linear", "log", "symlog", "logit", ...} or ScaleBase
yticklabels
unknown
yticks
unknown
zorder
float
Axes Divider
Axes Grid2
Parasite Simple2
Simple ImageGrid
Simple ImageGrid 2
Tight Layout guide


Set multiple properties at once.
Supported properties are
Property
Description
adjustable
{'box', 'datalim'}
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
anchor
(float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...}
animated
bool
aspect
{'auto', 'equal'} or float
autoscale_on
bool
autoscalex_on
bool
autoscaley_on
bool
axes_locator
Callable[[Axes, Renderer], Bbox]
axisbelow
bool or 'line'
box_aspect
float or None
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
facecolor or fc
color
figure
Figure
frame_on
bool
gid
str
in_layout
bool
label
object
navigate
bool
navigate_mode
unknown
path_effects
AbstractPathEffect
picker
None or bool or float or callable
position
[left, bottom, width, height] or Bbox
prop_cycle
unknown
rasterization_zorder
float or None
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
title
str
transform
Transform
url
str
visible
bool
xbound
unknown
xlabel
str
xlim
(bottom: float, top: float)
xmargin
float greater than -0.5
xscale
{"linear", "log", "symlog", "logit", ...} or ScaleBase
xticklabels
unknown
xticks
unknown
ybound
unknown
ylabel
str
ylim
(bottom: float, top: float)
ymargin
float greater than -0.5
yscale
{"linear", "log", "symlog", "logit", ...} or ScaleBase
yticklabels
unknown
yticks
unknown
zorder
float


Bases: matplotlib.artist.Artist
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
in_layout
bool
label
unknown
path_effects
AbstractPathEffect
picker
None or bool or float or callable
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
transform
Transform
url
str
visible
unknown
zorder
float
Set a label that will be displayed in the legend.
s will be converted to a string by calling str.
Set the artist's visibility.


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
in_layout
bool
label
unknown
path_effects
AbstractPathEffect
picker
None or bool or float or callable
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
transform
Transform
url
str
visible
unknown
zorder
float


Set a label that will be displayed in the legend.
s will be converted to a string by calling str.


HostAxes
alias of mpl_toolkits.axes_grid1.parasite_axes.AxesHostAxes
HostAxesBase(*args, **kwargs)
ParasiteAxes
alias of mpl_toolkits.axes_grid1.parasite_axes.AxesParasite
ParasiteAxesAuxTrans
alias of mpl_toolkits.axes_grid1.parasite_axes.AxesParasiteParasiteAuxTrans
ParasiteAxesAuxTransBase(parent_axes, ...[, ...])
[Deprecated]
ParasiteAxesBase(parent_axes[, ...])
host_axes(*args[, axes_class, figure])
Create axes that can act as a hosts to parasitic axes.
host_axes_class_factory(axes_class)
host_subplot(*args[, axes_class, figure])
Create a subplot that can act as a host to parasitic axes.
host_subplot_class_factory(axes_class)
parasite_axes_auxtrans_class_factory(axes_class)
[Deprecated]
parasite_axes_class_factory(axes_class)


Create axes that can act as a hosts to parasitic axes.
Figure to which the axes will be added. Defaults to the current figure pyplot.gcf().
Will be passed on to the underlying Axes object creation.


Create a subplot that can act as a host to parasitic axes.
Figure to which the subplot will be added. Defaults to the current figure pyplot.gcf().
Will be passed on to the underlying Axes object creation.


Bases: object
Add a parasite axes to this host.
Despite this method's name, this should actually be thought of as an add_parasite_axes method.
tr may be Transform, in which case the following relation will hold: parasite.transData = tr + host.transData. Alternatively, it may be None (the default), no special relationship will hold between the parasite's and the host's transData.
Create a twin of Axes with no shared axis.
While self will have ticks on the left and bottom axis, the returned axes will have ticks on the top and right axis.
Create a twin of Axes with a shared x-axis but independent y-axis.
The y-axis of self will have ticks on the left and the returned axes will have ticks on the right.
Create a twin of Axes with a shared y-axis but independent x-axis.
The x-axis of self will have ticks on the bottom and the returned axes will have ticks on the top.
Parasite Simple2
Curvilinear grid demo
mpl_toolkits.axisartist.floating_axes features
floating_axis demo
Parasite Axes demo


Add a parasite axes to this host.
Despite this method's name, this should actually be thought of as an add_parasite_axes method.
tr may be Transform, in which case the following relation will hold: parasite.transData = tr + host.transData. Alternatively, it may be None (the default), no special relationship will hold between the parasite's and the host's transData.


Create a twin of Axes with no shared axis.
While self will have ticks on the left and bottom axis, the returned axes will have ticks on the top and right axis.


Create a twin of Axes with a shared x-axis but independent y-axis.
The y-axis of self will have ticks on the left and the returned axes will have ticks on the right.


Create a twin of Axes with a shared y-axis but independent x-axis.
The x-axis of self will have ticks on the bottom and the returned axes will have ticks on the top.


[Deprecated]
Deprecated since version 3.4:


Bases: object
[Deprecated]
Deprecated since version 3.4:
[Deprecated]
Deprecated since version 3.4:


Bases: object
[Deprecated]
Deprecated since version 3.5:
[Deprecated]
Deprecated since version 3.4:
Parasite Axes demo


[Deprecated]
Deprecated since version 3.5:


Table of Contents
Axis objects
Classes for the ticks and x and y axis.
Base class for XAxis and YAxis.
The Axes instance the artist resides in, or None.
Determines the major tick positions and their label format.
Determines the minor tick positions and their label format.
The axis label.
The distance between the axis label and the tick labels. Defaults to rcParams["axes.labelpad"] (default: 4.0) = 4.
A Text object containing the data offset of the ticks (if any).
The acceptance radius for containment tests. See also Axis.contains.
The major ticks.
The minor ticks.
The Axes to which the created Axis belongs.
The acceptance radius for containment tests. See also Axis.contains.
The Axes to which the created Axis belongs.
The acceptance radius for containment tests. See also Axis.contains.
The Axes to which the created Axis belongs.
The acceptance radius for containment tests. See also Axis.contains.
A container for the objects defining tick position and format.
Determines the positions of the ticks.
Determines the format of the tick labels.
Axis.clear
Clear the axis.
Axis.cla
[Deprecated] Clear this axis.
Axis.get_scale
Return this Axis' scale (as a str).
Axis.get_major_formatter
Get the formatter of the major ticker.
Axis.get_major_locator
Get the locator of the major ticker.
Axis.get_minor_formatter
Get the formatter of the minor ticker.
Axis.get_minor_locator
Get the locator of the minor ticker.
Axis.set_major_formatter
Set the formatter of the major ticker.
Axis.set_major_locator
Set the locator of the major ticker.
Axis.set_minor_formatter
Set the formatter of the minor ticker.
Axis.set_minor_locator
Set the locator of the minor ticker.
Axis.remove_overlapping_locs
If minor ticker locations that overlap with major ticker locations should be trimmed.
Axis.get_remove_overlapping_locs
Axis.set_remove_overlapping_locs
Axis.set_label_coords
Set the coordinates of the label.
Axis.set_label_position
Set the label position (top or bottom)
Axis.set_label_text
Set the text value of the axis label.
Axis.get_label
Return the axis label as a Text instance.
Axis.get_label_position
Return the label position (top or bottom)
Axis.get_label_text
Get the text of the label.
Axis.get_major_ticks
Return the list of major Ticks.
Axis.get_majorticklabels
Return this Axis' major tick labels, as a list of Text.
Axis.get_majorticklines
Return this Axis' major tick lines as a list of Line2Ds.
Axis.get_majorticklocs
Return this Axis' major tick locations in data coordinates.
Axis.get_minor_ticks
Return the list of minor Ticks.
Axis.get_minorticklabels
Return this Axis' minor tick labels, as a list of Text.
Axis.get_minorticklines
Return this Axis' minor tick lines as a list of Line2Ds.
Axis.get_minorticklocs
Return this Axis' minor tick locations in data coordinates.
Axis.get_offset_text
Return the axis offsetText as a Text instance.
Axis.get_tick_padding
Axis.get_ticklabels
Get this Axis' tick labels.
Axis.get_ticklines
Return this Axis' tick lines as a list of Line2Ds.
Axis.get_ticklocs
Return this Axis' tick locations in data coordinates.
Axis.get_gridlines
Return this Axis' grid lines as a list of Line2Ds.
Axis.grid
Configure the grid lines.
Axis.set_tick_params
Set appearance parameters for ticks, ticklabels, and gridlines.
Axis.axis_date
Set up axis ticks and labels to treat data along this Axis as dates.
Axis.get_data_interval
Return the (min, max) data limits of this axis.
Axis.get_view_interval
Return the (min, max) view limits of this axis.
Axis.get_inverted
Return whether this Axis is oriented in the "inverse" direction.
Axis.set_data_interval
Set the axis data limits.
Axis.set_view_interval
Set the axis view limits.
Axis.set_inverted
Set whether this Axis is oriented in the "inverse" direction.
Axis.get_minpos
Axis.get_tick_space
Return the estimated number of ticks that can fit on the axis.
Axis.get_ticklabel_extents
Get the extents of the tick labels on either side of the axes.
Axis.get_tightbbox
Return a bounding box that encloses the axis.
Axis.contains
Test whether the artist contains the mouse event.
Axis.get_pickradius
Return the depth of the axis used by the picker.
Axis.set_pickradius
Set the depth of the axis used by the picker.
Axis.convert_units
Axis.set_units
Set the units for axis.
Axis.get_units
Return the units for axis.
Axis.update_units
Introspect data for units converter and update the axis.converter instance if necessary.
XAxis.axis_name
Read-only name identifying the axis.
XAxis.get_text_heights
Return how much space should be reserved for text above and below the axes, as a pair of floats.
XAxis.get_ticks_position
Return the ticks position ("top", "bottom", "default", or "unknown").
XAxis.set_ticks_position
Set the ticks position.
XAxis.set_label_position
Set the label position (top or bottom)
XAxis.tick_bottom
Move ticks and ticklabels (if present) to the bottom of the axes.
XAxis.tick_top
Move ticks and ticklabels (if present) to the top of the axes.
YAxis.axis_name
Read-only name identifying the axis.
YAxis.get_text_widths
YAxis.get_ticks_position
Return the ticks position ("left", "right", "default", or "unknown").
YAxis.set_offset_position
YAxis.set_ticks_position
Set the ticks position.
YAxis.set_label_position
Set the label position (left or right)
YAxis.tick_left
Move ticks and ticklabels (if present) to the left of the axes.
YAxis.tick_right
Move ticks and ticklabels (if present) to the right of the axes.
Axis.OFFSETTEXTPAD
Axis.axes
The Axes instance the artist resides in, or None.
Axis.limit_range_for_scale
Axis.reset_ticks
Re-initialize the major and minor Tick lists.
Axis.set_default_intervals
Set the default limits for the axis data and view interval if they have not been not mutated yet.
These methods should be used together with care, calling set_ticks to specify the desired tick locations before calling set_ticklabels to specify a matching series of labels. Calling set_ticks makes a FixedLocator; it's list of locations is then used by set_ticklabels to make an appropriate FuncFormatter.
Axis.set_ticks
Set this Axis' tick locations and optionally labels.
Axis.set_ticklabels
Set the text values of the tick labels.
Abstract base class for the axis ticks, grid lines and labels.
Ticks mark a position on an Axis. They contain two lines as markers and two labels; one each for the bottom and top positions (in case of an XAxis) or for the left and right positions (in case of a YAxis).
The left/bottom tick marker.
The right/top tick marker.
The grid line associated with the label position.
The left/bottom tick label.
The right/top tick label.
bbox is the Bound2D bounding box in display coords of the Axes loc is the tick location in data coords size is the tick size in points
Contains all the Artists needed to make an x tick - the tick line, the label text and the grid line
bbox is the Bound2D bounding box in display coords of the Axes loc is the tick location in data coords size is the tick size in points
Contains all the Artists needed to make a Y tick - the tick line, the label text and the grid line
bbox is the Bound2D bounding box in display coords of the Axes loc is the tick location in data coords size is the tick size in points
Tick.get_loc
Return the tick location (data coords) as a scalar.
Tick.get_pad
Get the value of the tick label pad in points.
Tick.get_pad_pixels
Tick.get_tick_padding
Get the length of the tick outside of the axes.
Tick.get_tickdir
Tick.get_view_interval
Return the view limits (min, max) of the axis the tick belongs to.
Tick.set_label1
Set the label1 text.
Tick.set_label2
Set the label2 text.
Tick.set_pad
Set the tick label pad in points
Tick.set_url
Set the url of label1 and label2.
Tick.update_position
Set the location of tick in data coords with scalar loc.


Base class for XAxis and YAxis.
The Axes instance the artist resides in, or None.
Determines the major tick positions and their label format.
Determines the minor tick positions and their label format.
The axis label.
The distance between the axis label and the tick labels. Defaults to rcParams["axes.labelpad"] (default: 4.0) = 4.
A Text object containing the data offset of the ticks (if any).
The acceptance radius for containment tests. See also Axis.contains.
The major ticks.
The minor ticks.
The Axes to which the created Axis belongs.
The acceptance radius for containment tests. See also Axis.contains.


The Axes instance the artist resides in, or None.


Set up axis ticks and labels to treat data along this Axis as dates.
The timezone used to create date labels.


[Deprecated] Clear this axis.
Deprecated since version 3.4.


Clear the axis.
This resets axis properties to their default values:


Test whether the artist contains the mouse event.
Whether any values are within the radius.
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.


Return the (min, max) data limits of this axis.


Return this Axis' grid lines as a list of Line2Ds.


Return whether this Axis is oriented in the "inverse" direction.
The "normal" direction is increasing to the right for the x-axis and to the top for the y-axis; the "inverse" direction is increasing to the left for the x-axis and to the bottom for the y-axis.


Return the axis label as a Text instance.
Parasite Simple


Return the label position (top or bottom)


Get the locator of the major ticker.
Date tick labels
Inset Locator Demo2
Basic Usage


Return this Axis' major tick labels, as a list of Text.


Return this Axis' major tick lines as a list of Line2Ds.


Return this Axis' major tick locations in data coordinates.


Return the list of minor Ticks.
Centering labels between ticks


Return this Axis' minor tick labels, as a list of Text.


Return this Axis' minor tick lines as a list of Line2Ds.


Return this Axis' minor tick locations in data coordinates.


Return the axis offsetText as a Text instance.


Return the depth of the axis used by the picker.


Return the estimated number of ticks that can fit on the axis.


Get the extents of the tick labels on either side of the axes.


Get this Axis' tick labels.
Whether to return the minor or the major ticklabels.
Overrides minor.
Selects which ticklabels to return
The tick label strings are not populated until a draw method has been called.
See also: draw and draw.
Image Masked
Fig Axes Customize Simple
Artist tutorial


Return this Axis' tick lines as a list of Line2Ds.
Fig Axes Customize Simple
Artist tutorial


Return this Axis' tick locations in data coordinates.
Artist tutorial


Return a bounding box that encloses the axis. It only accounts tick labels, axis label, and offsetText.
If for_layout_only is True, then the width of the label (if this is an x-axis) or the height of the label (if this is a y-axis) is collapsed to near zero. This allows tight/constrained_layout to ignore too-long labels when doing their layout.


Return the (min, max) view limits of this axis.


Configure the grid lines.
Whether to show the grid lines. If any kwargs are supplied, it is assumed you want the grid on and visible will be set to True.
If visible is None and there are no kwargs, this toggles the visibility of the lines.
The grid lines to apply the changes on.
Define the line properties of the grid, e.g.:
Box plots with custom fill colors
Boxplots
Box plot vs. violin plot comparison
Symlog Demo


If minor ticker locations that overlap with major ticker locations should be trimmed.


Re-initialize the major and minor Tick lists.
Each list starts with a single fresh Tick.


Set the axis data limits. This method is for internal use.
If ignore is False (the default), this method will never reduce the preexisting data limits, only expand them if vmin or vmax are not within them. Moreover, the order of vmin and vmax does not matter; the orientation of the axis will not change.
If ignore is True, the data limits will be set exactly to (vmin,
vmax) in that order.


Set the default limits for the axis data and view interval if they have not been not mutated yet.


Set whether this Axis is oriented in the "inverse" direction.
The "normal" direction is increasing to the right for the x-axis and to the top for the y-axis; the "inverse" direction is increasing to the left for the x-axis and to the bottom for the y-axis.


Set the coordinates of the label.
By default, the x coordinate of the y label and the y coordinate of the x label are determined by the tick label bounding boxes, but this can lead to poor alignment of multiple labels if there are multiple axes.
You can also specify the coordinate system of the label with the transform. If None, the default coordinate system will be the axes coordinate system: (0, 0) is bottom left, (0.5, 0.5) is center, etc.


Set the label position (top or bottom)
Title positioning


Set the text value of the axis label.
Text string.
Text properties.
Merged into fontdict.


Set the formatter of the major ticker.
In addition to a Formatter instance, this also accepts a str or function.
For a str a StrMethodFormatter is used. The field used for the value must be labeled 'x' and the field used for the position must be labeled 'pos'. See the StrMethodFormatter documentation for more information.
For a function, a FuncFormatter is used. The function must take two inputs (a tick value x and a position pos), and return a string containing the corresponding tick label. See the FuncFormatter documentation for more information.
Creating a timeline with lines, dates, and text
Date tick labels
Custom tick formatter for time series
Labeling ticks using engineering notation
Dollar Ticks
Bachelor's degrees by gender
3D surface (colormap)
SkewT-logP diagram: using transforms and custom projections
Centering labels between ticks
Custom Ticker1
Formatting date ticks using ConciseDateFormatter
Date Demo Convert
Placing date ticks using recurrence rules
Date Index Formatter
Major and minor ticks
Setting tick labels from a list of values
Basic Usage
The Lifecycle of a Plot
Artist tutorial
Choosing Colormaps in Matplotlib
Text in Matplotlib Plots


Set the locator of the major ticker.
Hatch-filled histograms
Creating a timeline with lines, dates, and text
Date tick labels
Anatomy of a figure
3D surface (colormap)
3D surface (checkerboard)
Scales
MRI With EEG
SkewT-logP diagram: using transforms and custom projections
Centering labels between ticks
Formatting date ticks using ConciseDateFormatter
Date Demo Convert
Placing date ticks using recurrence rules
Major and minor ticks
Setting tick labels from a list of values
Choosing Colormaps in Matplotlib
Text in Matplotlib Plots


Set the formatter of the minor ticker.
In addition to a Formatter instance, this also accepts a str or function. See Axis.set_major_formatter for more information.
Anatomy of a figure
Scales
SkewT-logP diagram: using transforms and custom projections
Centering labels between ticks


Set the locator of the minor ticker.
Secondary Axis
Date tick labels
Anatomy of a figure
Centering labels between ticks
Date Demo Convert
Major and minor ticks


Set the depth of the axis used by the picker.


Set appearance parameters for ticks, ticklabels, and gridlines.
For documentation of keyword arguments, see matplotlib.axes.Axes.tick_params().
Violin plot customization
Dollar Ticks
Scatter Histogram (Locatable Axes)
Pythonic Matplotlib
Placing date ticks using recurrence rules
Date Precision and Epochs
Choosing Colormaps in Matplotlib


Set the text values of the tick labels.
Discouraged
The use of this method is discouraged, because of the dependency on tick positions. In most cases, you'll want to use set_[x/y]ticks(positions, labels) instead.
If you are using this method, you should always fix the tick positions before, e.g. by using Axis.set_ticks or by explicitly setting a FixedLocator. Otherwise, ticks are free to move and the labels may end up in unexpected positions.
Texts for labeling each tick location in the sequence set by Axis.set_ticks; the number of labels must match the number of locations.
If True, set minor ticks instead of major ticks.
Text properties.
For each tick, includes tick.label1 if it is visible, then tick.label2 if it is visible, in that order.


Set this Axis' tick locations and optionally labels.
If necessary, the view limits of the Axis are expanded so that all given ticks are visible.
List of tick locations.
List of tick labels. If not set, the labels show the data value.
If False, set the major ticks; if True, the minor ticks.
Text properties for the labels. These take effect only if you pass labels. In other cases, please use tick_params.
The mandatory expansion of the view limits is an intentional design choice to prevent the surprise of a non-visible tick. If you need other limits, you should set the limits explicitly after setting the ticks.
Spine Placement


Set the units for axis.
The units of any shared axis will also be updated.
Artist tests
Group barchart with units
Unit handling


Set the axis view limits. This method is for internal use; Matplotlib users should typically use e.g. set_xlim or set_ylim.
If ignore is False (the default), this method will never reduce the preexisting view limits, only expand them if vmin or vmax are not within them. Moreover, the order of vmin and vmax does not matter; the orientation of the axis will not change.
If ignore is True, the view limits will be set exactly to (vmin,
vmax) in that order.


Introspect data for units converter and update the axis.converter instance if necessary. Return True if data is registered for unit conversion.


Abstract base class for the axis ticks, grid lines and labels.
Ticks mark a position on an Axis. They contain two lines as markers and two labels; one each for the bottom and top positions (in case of an XAxis) or for the left and right positions (in case of a YAxis).
The left/bottom tick marker.
The right/top tick marker.
The grid line associated with the label position.
The left/bottom tick label.
The right/top tick label.
bbox is the Bound2D bounding box in display coords of the Axes loc is the tick location in data coords size is the tick size in points


Return the tick location (data coords) as a scalar.


Get the value of the tick label pad in points.


Get the length of the tick outside of the axes.


Return the view limits (min, max) of the axis the tick belongs to.


Set the location of tick in data coords with scalar loc.


A container for the objects defining tick position and format.
Determines the positions of the ticks.
Determines the format of the tick labels.


The Axes to which the created Axis belongs.
The acceptance radius for containment tests. See also Axis.contains.


Return how much space should be reserved for text above and below the axes, as a pair of floats.


Return the ticks position ("top", "bottom", "default", or "unknown").


Set the label position (top or bottom)
Title positioning


Set the ticks position.
'both' sets the ticks to appear on both positions, but does not change the tick labels. 'default' resets the tick positions to the default: ticks on both positions, labels at bottom. 'none' can be used if you don't want any ticks. 'none' and 'both' affect only the ticks, not the labels.
Violin plot customization
Colorbar with AxesDivider
Controlling the position and size of colorbars with Inset Axes
Integral as the area under a curve
XKCD
Spine Placement
Spines
Custom spine bounds
Dropped spines
Choosing Colormaps in Matplotlib


Move ticks and ticklabels (if present) to the bottom of the axes.
Broken Axis
Bachelor's degrees by gender


Move ticks and ticklabels (if present) to the top of the axes.
Broken Axis
Title positioning


Contains all the Artists needed to make an x tick - the tick line, the label text and the grid line
bbox is the Bound2D bounding box in display coords of the Axes loc is the tick location in data coords size is the tick size in points


Return the ticks position ("left", "right", "default", or "unknown").


Set the ticks position.
'both' sets the ticks to appear on both positions, but does not change the tick labels. 'default' resets the tick positions to the default: ticks on both positions, labels at left. 'none' can be used if you don't want any ticks. 'none' and 'both' affect only the ticks, not the labels.
Spine Placement
Spines
Custom spine bounds
Dropped spines


Move ticks and ticklabels (if present) to the left of the axes.
Bachelor's degrees by gender
Set default y-axis tick labels on the right


Move ticks and ticklabels (if present) to the right of the axes.


Contains all the Artists needed to make a Y tick - the tick line, the label text and the grid line
bbox is the Bound2D bounding box in display coords of the Axes loc is the tick location in data coords size is the tick size in points


The axisartist namespace provides a derived Axes implementation (mpl_toolkits.axisartist.Axes), designed to support curvilinear grids. The biggest difference is that the artists that are responsible for drawing axis lines, ticks, ticklabels, and axis labels are separated out from Matplotlib's Axis class.
You can find a tutorial describing usage of axisartist at the axisartist user guide.
The submodules of the axisartist API are:
axisartist.angle_helper
axisartist.axes_divider
axisartist.axes_grid
axisartist.axes_rgb
axisartist.axis_artist
The axis_artist module implements custom artists to draw axis elements (axis lines and labels, tick lines and labels, grid lines).
axisartist.axisline_style
axisartist.axislines
Axislines includes modified implementation of the Axes class.
axisartist.clip_path
axisartist.floating_axes
An experimental support for curvilinear grid.
axisartist.grid_finder
axisartist.grid_helper_curvelinear
An experimental support for curvilinear grid.
axisartist.parasite_axes


ExtremeFinderCycle(nx, ny[, lon_cycle, ...])
This subclass handles the case where one or both coordinates should be taken modulo 360, or be restricted to not exceed a specific range.
FormatterDMS()
FormatterHMS()
LocatorBase(nbins[, include_last])
LocatorD(nbins[, include_last])
LocatorDM(nbins[, include_last])
LocatorDMS(nbins[, include_last])
LocatorH(nbins[, include_last])
LocatorHM(nbins[, include_last])
LocatorHMS(nbins[, include_last])
select_step(v1, v2, nv[, hour, ...])
select_step24(v1, v2, nv[, include_last, ...])
select_step360(v1, v2, nv[, include_last, ...])
select_step_degree(dv)
select_step_hour(dv)
select_step_sub(dv)


Bases: mpl_toolkits.axisartist.grid_finder.ExtremeFinderSimple
This subclass handles the case where one or both coordinates should be taken modulo 360, or be restricted to not exceed a specific range.
The number of samples in each direction.
If not None, values in the corresponding direction are taken modulo lon_cycle or lat_cycle; in theory this can be any number but the implementation actually assumes that it is 360 (if not None); other values give nonsensical results.
This is done by "unwrapping" the transformed grid coordinates so that jumps are less than a half-cycle; then normalizing the span to no more than a full cycle.
For example, if values are in the union of the [0, 2] and [358, 360] intervals (typically, angles measured modulo 360), the values in the second interval are normalized to [-2, 0] instead so that the values now cover [-2, 2]. If values are in a range of [5, 1000], this gets normalized to [5, 365].
If not None, the computed bounding box is clipped to the given range in the corresponding direction.
Compute an approximation of the bounding box obtained by applying transform_xy to the box delimited by (x1, y1, x2, y2).
The intended use is to have (x1, y1, x2, y2) in axes coordinates, and have transform_xy be the transform from axes coordinates to data coordinates; this method then returns the range of data coordinates that span the actual axes.
The computation is done by sampling nx * ny equispaced points in the (x1, y1, x2, y2) box and finding the resulting points with extremal coordinates; then adding some padding to take into account the finite sampling.
As each sampling step covers a relative range of 1/nx or 1/ny, the padding is computed by expanding the span covered by the extremal coordinates by these fractions.
axis_direction demo
Curvilinear grid demo
floating_axis demo
Simple Axis Pad