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.


Bases: object
Call self as a function.
axis_direction demo
Curvilinear grid demo
mpl_toolkits.axisartist.floating_axes features
floating_axis demo
Simple Axis Pad


Bases: mpl_toolkits.axisartist.angle_helper.FormatterDMS
Call self as a function.
mpl_toolkits.axisartist.floating_axes features


Bases: object
axis_direction demo
Curvilinear grid demo
mpl_toolkits.axisartist.floating_axes features
floating_axis demo
Simple Axis Pad


Bases: mpl_toolkits.axisartist.angle_helper.LocatorBase
Call self as a function.


Bases: mpl_toolkits.axisartist.angle_helper.LocatorBase
Call self as a function.
axis_direction demo
Curvilinear grid demo
floating_axis demo
Simple Axis Pad


Bases: mpl_toolkits.axisartist.angle_helper.LocatorBase
Call self as a function.
mpl_toolkits.axisartist.floating_axes features


AxesGrid
alias of mpl_toolkits.axisartist.axes_grid.ImageGrid
CbarAxes(*args, orientation, **kwargs)
[Deprecated]
Grid(fig, rect, nrows_ncols[, ngrids, ...])
ImageGrid(fig, rect, nrows_ncols[, ngrids, ...])


Bases: mpl_toolkits.axes_grid1.axes_grid.CbarAxesBase, mpl_toolkits.axisartist.axislines.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: 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. 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.


Bases: mpl_toolkits.axes_grid1.axes_grid.ImageGrid
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.


Bases: mpl_toolkits.axes_grid1.axes_rgb.RGBAxes
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


The axis_artist module implements custom artists to draw axis elements (axis lines and labels, tick lines and labels, grid lines).
Axis lines and labels and tick lines and labels are managed by the AxisArtist class; grid lines are managed by the GridlinesCollection class.
There is one AxisArtist per Axis; it can be accessed through the axis dictionary of the parent Axes (which should be a mpl_toolkits.axislines.Axes), e.g. ax.axis["bottom"].
Children of the AxisArtist are accessed as attributes: .line and .label for the axis line and label, .major_ticks, .major_ticklabels, .minor_ticks, .minor_ticklabels for the tick lines and labels (e.g. ax.axis["bottom"].line).
Children properties (colors, fonts, line widths, etc.) can be set using setters, e.g.
However, things like the locations of ticks, and their ticklabels need to be changed from the side of the grid_helper.
AxisArtist, AxisLabel, TickLabels have an axis_direction attribute, which adjusts the location, angle, etc. The axis_direction must be one of "left", "right", "bottom", "top", and follows the Matplotlib convention for rectangular axis.
For example, for the bottom axis (the left and right is relative to the direction of the increasing coordinate),
The text angles are actually relative to (90 + angle of the direction to the ticklabel), which gives 0 for bottom axis.
Parameter
left
bottom
right
top
ticklabels location
left
right
right
left
axislabel location
left
right
right
left
ticklabels angle
90
0
-90
180
axislabel angle
180
0
0
180
ticklabel va
center
baseline
center
baseline
axislabel va
center
top
center
bottom
ticklabel ha
right
center
right
center
axislabel ha
right
center
right
center
Ticks are by default direct opposite side of the ticklabels. To make ticks to the same side of the ticklabels,
The following attributes can be customized (use the set_xxx methods):
AttributeCopier()
AxisArtist(axes, helper[, offset, ...])
An artist which draws axis (a line along which the n-th axes coord is constant) line, ticks, ticklabels, and axis label.
AxisLabel(*args[, axis_direction, axis])
Axis Label.
GridlinesCollection(*args[, which, axis])
LabelBase(*args, **kwargs)
A base class for AxisLabel and TickLabels.
TickLabels(*[, axis_direction])
Tick Labels.
Ticks(ticksize[, tick_out, axis])
Ticks are derived from Line2D, and note that ticks themselves are markers.


Bases: object
Return the underlying artist that actually defines some properties (e.g., color) of this artist.


Return the underlying artist that actually defines some properties (e.g., color) of this artist.


Bases: matplotlib.artist.Artist
An artist which draws axis (a line along which the n-th axes coord is constant) line, ticks, ticklabels, and axis label.
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible (Artist.get_visible returns False).
This method is overridden in the Artist subclasses.
Return the current axisline style.
Return axis artist helper instance.
Like Artist.get_window_extent, but includes any clipping.
renderer that will be used to draw the figures (i.e. fig.canvas.get_renderer())
The enclosing bounding box (in figure pixel coordinates).
Return the Transform instance used by this 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
axis_direction
unknown
axislabel_direction
{"+", "-"}
axisline_style
str or None
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
ticklabel_direction
{"+", "-"}
transform
Transform
url
str
visible
bool
zorder
float
Adjust the direction, text angle, text alignment of ticklabels, labels following the matplotlib convention for the rectangle axes.
The axis_direction must be one of [left, right, bottom, top].
property
left
bottom
right
top
ticklabels location
"-"
"+"
"+"
"-"
axislabel location
"-"
"+"
"+"
"-"
ticklabels angle
90
0
-90
180
ticklabel va
center
baseline
center
baseline
ticklabel ha
right
center
right
center
axislabel angle
180
0
0
180
axislabel va
center
top
center
bottom
axislabel ha
right
center
right
center
Note that the direction "+" and "-" are relative to the direction of the increasing coordinate. Also, the text angles are actually relative to (90 + angle of the direction to the ticklabel), which gives 0 for bottom axis.
Adjust the direction of the axislabel.
Note that the label_directions '+' and '-' are relative to the direction of the increasing coordinate.
Set the axisline style.
The new style is completely defined by the passed attributes. Existing style attributes are forgotten.
The line style, e.g. '->', optionally followed by a comma-separated list of attributes. Alternatively, the attributes can be provided as keywords.
If None this returns a string containing the available styles.
The following two commands are equal: >>> set_axisline_style("->,size=1.5") >>> set_axisline_style("->", size=1.5)
Set a label that will be displayed in the legend.
s will be converted to a string by calling str.
Adjust the direction of the ticklabel.
Note that the label_directions '+' and '-' are relative to the direction of the increasing coordinate.
Toggle visibility of ticks, ticklabels, and (axis) label. To turn all off,
To turn all off but ticks on
To turn all on but (axis) label off


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


Like Artist.get_window_extent, but includes any clipping.
renderer that will be used to draw the figures (i.e. fig.canvas.get_renderer())
The enclosing bounding box (in figure pixel coordinates).


Return the Transform instance used by this 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
axis_direction
unknown
axislabel_direction
{"+", "-"}
axisline_style
str or None
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
ticklabel_direction
{"+", "-"}
transform
Transform
url
str
visible
bool
zorder
float


Adjust the direction, text angle, text alignment of ticklabels, labels following the matplotlib convention for the rectangle axes.
The axis_direction must be one of [left, right, bottom, top].
property
left
bottom
right
top
ticklabels location
"-"
"+"
"+"
"-"
axislabel location
"-"
"+"
"+"
"-"
ticklabels angle
90
0
-90
180
ticklabel va
center
baseline
center
baseline
ticklabel ha
right
center
right
center
axislabel angle
180
0
0
180
axislabel va
center
top
center
bottom
axislabel ha
right
center
right
center
Note that the direction "+" and "-" are relative to the direction of the increasing coordinate. Also, the text angles are actually relative to (90 + angle of the direction to the ticklabel), which gives 0 for bottom axis.


Adjust the direction of the axislabel.
Note that the label_directions '+' and '-' are relative to the direction of the increasing coordinate.


Set the axisline style.
The new style is completely defined by the passed attributes. Existing style attributes are forgotten.
The line style, e.g. '->', optionally followed by a comma-separated list of attributes. Alternatively, the attributes can be provided as keywords.
If None this returns a string containing the available styles.
The following two commands are equal: >>> set_axisline_style("->,size=1.5") >>> set_axisline_style("->", size=1.5)


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


Adjust the direction of the ticklabel.
Note that the label_directions '+' and '-' are relative to the direction of the increasing coordinate.


Toggle visibility of ticks, ticklabels, and (axis) label. To turn all off,
To turn all off but ticks on
To turn all on but (axis) label off


Bases: mpl_toolkits.axisartist.axis_artist.AttributeCopier, mpl_toolkits.axisartist.axis_artist.LabelBase
Axis Label. Derived from Text. The position of the text is updated in the fly, so changing text position has no effect. Otherwise, the properties can be changed as a normal Text.
To change the pad between ticklabels and axis label, use set_pad.
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible (Artist.get_visible returns False).
This method is overridden in the Artist subclasses.
Return the color of the text.
Return the internal pad in points.
See set_pad for more details.
Return the underlying artist that actually defines some properties (e.g., color) of this artist.
Return the text string.
Return the Bbox bounding the text, in display units.
In addition to being used internally, this is useful for specifying clickable regions in a png file on a web page.
A renderer is needed to compute the bounding box. If the artist has already been drawn, the renderer is cached; thus, it is only necessary to pass this argument when calling get_window_extent before the first draw. In practice, it is usually easier to trigger a draw first (e.g. by saving the figure).
The dpi value for computing the bbox, defaults to self.figure.dpi (not the renderer dpi); should be set e.g. if to match regions with a figure saved with a custom dpi value.
Set multiple properties at once.
Supported properties are
Property
Description
agg_filter
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha
scalar or None
animated
bool
axis_direction
unknown
backgroundcolor
color
bbox
dict with properties for patches.FancyBboxPatch
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
color or c
color
default_alignment
unknown
default_angle
unknown
figure
Figure
fontfamily or family
{FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'}
fontproperties or font or font_properties
font_manager.FontProperties or str or pathlib.Path
fontsize or size
float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}
fontstretch or stretch
{a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'}
fontstyle or style
{'normal', 'italic', 'oblique'}
fontvariant or variant
{'normal', 'small-caps'}
fontweight or weight
{a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'}
gid
str
horizontalalignment or ha
{'center', 'right', 'left'}
in_layout
bool
label
object
linespacing
float (multiple of font size)
math_fontfamily
str
multialignment or ma
{'left', 'right', 'center'}
pad
unknown
parse_math
bool
path_effects
AbstractPathEffect
picker
None or bool or float or callable
position
(float, float)
rasterized
bool
rotation
float or {'vertical', 'horizontal'}
rotation_mode
{None, 'default', 'anchor'}
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
text
object
transform
Transform
transform_rotates_text
bool
url
str
usetex
bool or None
verticalalignment or va
{'center', 'top', 'bottom', 'baseline', 'center_baseline'}
visible
bool
wrap
bool
x
float
y
float
zorder
float
Adjust the text angle and text alignment of axis label according to the matplotlib convention.
property
left
bottom
right
top
axislabel angle
180
0
0
180
axislabel va
center
top
center
bottom
axislabel ha
right
center
right
center
Note that the text angles are actually relative to (90 + angle of the direction to the ticklabel), which gives 0 for bottom axis.
Set the internal pad in points.
The actual pad will be the sum of the internal pad and the external pad (the latter is set automatically by the AxisArtist).


Return the internal pad in points.
See set_pad for more details.


Return the Bbox bounding the text, in display units.
In addition to being used internally, this is useful for specifying clickable regions in a png file on a web page.
A renderer is needed to compute the bounding box. If the artist has already been drawn, the renderer is cached; thus, it is only necessary to pass this argument when calling get_window_extent before the first draw. In practice, it is usually easier to trigger a draw first (e.g. by saving the figure).
The dpi value for computing the bbox, defaults to self.figure.dpi (not the renderer dpi); should be set e.g. if to match regions with a figure saved with a custom dpi value.


Set multiple properties at once.
Supported properties are
Property
Description
agg_filter
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha
scalar or None
animated
bool
axis_direction
unknown
backgroundcolor
color
bbox
dict with properties for patches.FancyBboxPatch
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
color or c
color
default_alignment
unknown
default_angle
unknown
figure
Figure
fontfamily or family
{FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'}
fontproperties or font or font_properties
font_manager.FontProperties or str or pathlib.Path
fontsize or size
float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}
fontstretch or stretch
{a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'}
fontstyle or style
{'normal', 'italic', 'oblique'}
fontvariant or variant
{'normal', 'small-caps'}
fontweight or weight
{a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'}
gid
str
horizontalalignment or ha
{'center', 'right', 'left'}
in_layout
bool
label
object
linespacing
float (multiple of font size)
math_fontfamily
str
multialignment or ma
{'left', 'right', 'center'}
pad
unknown
parse_math
bool
path_effects
AbstractPathEffect
picker
None or bool or float or callable
position
(float, float)
rasterized
bool
rotation
float or {'vertical', 'horizontal'}
rotation_mode
{None, 'default', 'anchor'}
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
text
object
transform
Transform
transform_rotates_text
bool
url
str
usetex
bool or None
verticalalignment or va
{'center', 'top', 'bottom', 'baseline', 'center_baseline'}
visible
bool
wrap
bool
x
float
y
float
zorder
float


Adjust the text angle and text alignment of axis label according to the matplotlib convention.
property
left
bottom
right
top
axislabel angle
180
0
0
180
axislabel va
center
top
center
bottom
axislabel ha
right
center
right
center
Note that the text angles are actually relative to (90 + angle of the direction to the ticklabel), which gives 0 for bottom axis.


Set the internal pad in points.
The actual pad will be the sum of the internal pad and the external pad (the latter is set automatically by the AxisArtist).


Bases: matplotlib.collections.LineCollection
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible (Artist.get_visible returns False).
This method is overridden in the Artist subclasses.
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
array-like or scalar or None
animated
bool
antialiased or aa or antialiaseds
bool or list of bools
array
array-like or None
axis
unknown
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clim
(vmin: float, vmax: float)
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
cmap
Colormap or str or None
color
color or list of colors
colors
color or list of colors
edgecolor or ec or edgecolors
color or list of colors or 'face'
facecolor or facecolors or fc
color or list of colors
figure
Figure
gid
str
grid_helper
unknown
hatch
{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout
bool
joinstyle
JoinStyle or {'miter', 'round', 'bevel'}
label
object
linestyle or dashes or linestyles or ls
str or tuple or list thereof
linewidth or linewidths or lw
float or list of floats
norm
Normalize or None
offset_transform
Transform
offsets
(N, 2) or (2,) array-like
path_effects
AbstractPathEffect
paths
unknown
picker
None or bool or float or callable
pickradius
float
rasterized
bool
segments
unknown
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
transform
Transform
url
str
urls
list of str or None
verts
unknown
visible
bool
which
unknown
zorder
float


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


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
array-like or scalar or None
animated
bool
antialiased or aa or antialiaseds
bool or list of bools
array
array-like or None
axis
unknown
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clim
(vmin: float, vmax: float)
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
cmap
Colormap or str or None
color
color or list of colors
colors
color or list of colors
edgecolor or ec or edgecolors
color or list of colors or 'face'
facecolor or facecolors or fc
color or list of colors
figure
Figure
gid
str
grid_helper
unknown
hatch
{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout
bool
joinstyle
JoinStyle or {'miter', 'round', 'bevel'}
label
object
linestyle or dashes or linestyles or ls
str or tuple or list thereof
linewidth or linewidths or lw
float or list of floats
norm
Normalize or None
offset_transform
Transform
offsets
(N, 2) or (2,) array-like
path_effects
AbstractPathEffect
paths
unknown
picker
None or bool or float or callable
pickradius
float
rasterized
bool
segments
unknown
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
transform
Transform
url
str
urls
list of str or None
verts
unknown
visible
bool
which
unknown
zorder
float


Bases: matplotlib.text.Text
A base class for AxisLabel and TickLabels. The position and angle of the text are calculated by to offset_ref_angle, text_ref_angle, and offset_radius attributes.
Create a Text instance at x, y with string text.
Valid keyword arguments are:
Property
Description
agg_filter
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha
scalar or None
animated
bool
backgroundcolor
color
bbox
dict with properties for patches.FancyBboxPatch
clip_box
unknown
clip_on
unknown
clip_path
unknown
color or c
color
figure
Figure
fontfamily or family
{FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'}
fontproperties or font or font_properties
font_manager.FontProperties or str or pathlib.Path
fontsize or size
float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}
fontstretch or stretch
{a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'}
fontstyle or style
{'normal', 'italic', 'oblique'}
fontvariant or variant
{'normal', 'small-caps'}
fontweight or weight
{a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'}
gid
str
horizontalalignment or ha
{'center', 'right', 'left'}
in_layout
bool
label
object
linespacing
float (multiple of font size)
math_fontfamily
str
multialignment or ma
{'left', 'right', 'center'}
parse_math
bool
path_effects
AbstractPathEffect
picker
None or bool or float or callable
position
(float, float)
rasterized
bool
rotation
float or {'vertical', 'horizontal'}
rotation_mode
{None, 'default', 'anchor'}
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
text
object
transform
Transform
transform_rotates_text
bool
url
str
usetex
bool or None
verticalalignment or va
{'center', 'top', 'bottom', 'baseline', 'center_baseline'}
visible
bool
wrap
bool
x
float
y
float
zorder
float
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible (Artist.get_visible returns False).
This method is overridden in the Artist subclasses.
Return the Bbox bounding the text, in display units.
In addition to being used internally, this is useful for specifying clickable regions in a png file on a web page.
A renderer is needed to compute the bounding box. If the artist has already been drawn, the renderer is cached; thus, it is only necessary to pass this argument when calling get_window_extent before the first draw. In practice, it is usually easier to trigger a draw first (e.g. by saving the figure).
The dpi value for computing the bbox, defaults to self.figure.dpi (not the renderer dpi); should be set e.g. if to match regions with a figure saved with a custom dpi value.
Set multiple properties at once.
Supported properties are
Property
Description
agg_filter
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha
scalar or None
animated
bool
backgroundcolor
color
bbox
dict with properties for patches.FancyBboxPatch
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
color or c
color
figure
Figure
fontfamily or family
{FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'}
fontproperties or font or font_properties
font_manager.FontProperties or str or pathlib.Path
fontsize or size
float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}
fontstretch or stretch
{a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'}
fontstyle or style
{'normal', 'italic', 'oblique'}
fontvariant or variant
{'normal', 'small-caps'}
fontweight or weight
{a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'}
gid
str
horizontalalignment or ha
{'center', 'right', 'left'}
in_layout
bool
label
object
linespacing
float (multiple of font size)
math_fontfamily
str
multialignment or ma
{'left', 'right', 'center'}
parse_math
bool
path_effects
AbstractPathEffect
picker
None or bool or float or callable
position
(float, float)
rasterized
bool
rotation
float or {'vertical', 'horizontal'}
rotation_mode
{None, 'default', 'anchor'}
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
text
object
transform
Transform
transform_rotates_text
bool
url
str
usetex
bool or None
verticalalignment or va
{'center', 'top', 'bottom', 'baseline', 'center_baseline'}
visible
bool
wrap
bool
x
float
y
float
zorder
float


Set multiple properties at once.
Supported properties are
Property
Description
agg_filter
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha
scalar or None
animated
bool
backgroundcolor
color
bbox
dict with properties for patches.FancyBboxPatch
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
color or c
color
figure
Figure
fontfamily or family
{FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'}
fontproperties or font or font_properties
font_manager.FontProperties or str or pathlib.Path
fontsize or size
float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}
fontstretch or stretch
{a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'}
fontstyle or style
{'normal', 'italic', 'oblique'}
fontvariant or variant
{'normal', 'small-caps'}
fontweight or weight
{a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'}
gid
str
horizontalalignment or ha
{'center', 'right', 'left'}
in_layout
bool
label
object
linespacing
float (multiple of font size)
math_fontfamily
str
multialignment or ma
{'left', 'right', 'center'}
parse_math
bool
path_effects
AbstractPathEffect
picker
None or bool or float or callable
position
(float, float)
rasterized
bool
rotation
float or {'vertical', 'horizontal'}
rotation_mode
{None, 'default', 'anchor'}
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
text
object
transform
Transform
transform_rotates_text
bool
url
str
usetex
bool or None
verticalalignment or va
{'center', 'top', 'bottom', 'baseline', 'center_baseline'}
visible
bool
wrap
bool
x
float
y
float
zorder
float


Bases: mpl_toolkits.axisartist.axis_artist.AxisLabel
Tick Labels. While derived from Text, this single artist draws all ticklabels. As in AxisLabel, the position of the text is updated in the fly, so changing text position has no effect. Otherwise, the properties can be changed as a normal Text. Unlike the ticklabels of the mainline matplotlib, properties of single ticklabel alone cannot modified.
To change the pad between ticks and ticklabels, use set_pad.
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible (Artist.get_visible returns False).
This method is overridden in the Artist subclasses.
Return the underlying artist that actually defines some properties (e.g., color) of this artist.
Return a list of (width, height, descent) tuples for ticklabels.
Empty labels are left out.
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
axis_direction
unknown
backgroundcolor
color
bbox
dict with properties for patches.FancyBboxPatch
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
color or c
color
default_alignment
unknown
default_angle
unknown
figure
Figure
fontfamily or family
{FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'}
fontproperties or font or font_properties
font_manager.FontProperties or str or pathlib.Path
fontsize or size
float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}
fontstretch or stretch
{a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'}
fontstyle or style
{'normal', 'italic', 'oblique'}
fontvariant or variant
{'normal', 'small-caps'}
fontweight or weight
{a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'}
gid
str
horizontalalignment or ha
{'center', 'right', 'left'}
in_layout
bool
label
object
linespacing
float (multiple of font size)
locs_angles_labels
unknown
math_fontfamily
str
multialignment or ma
{'left', 'right', 'center'}
pad
unknown
parse_math
bool
path_effects
AbstractPathEffect
picker
None or bool or float or callable
position
(float, float)
rasterized
bool
rotation
float or {'vertical', 'horizontal'}
rotation_mode
{None, 'default', 'anchor'}
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
text
object
transform
Transform
transform_rotates_text
bool
url
str
usetex
bool or None
verticalalignment or va
{'center', 'top', 'bottom', 'baseline', 'center_baseline'}
visible
bool
wrap
bool
x
float
y
float
zorder
float
Adjust the text angle and text alignment of ticklabels according to the matplotlib convention.
The label_direction must be one of [left, right, bottom, top].
property
left
bottom
right
top
ticklabels angle
90
0
-90
180
ticklabel va
center
baseline
center
baseline
ticklabel ha
right
center
right
center
Note that the text angles are actually relative to (90 + angle of the direction to the ticklabel), which gives 0 for bottom axis.


Return the underlying artist that actually defines some properties (e.g., color) of this artist.


Return a list of (width, height, descent) tuples for ticklabels.
Empty labels are left out.


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
axis_direction
unknown
backgroundcolor
color
bbox
dict with properties for patches.FancyBboxPatch
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
color or c
color
default_alignment
unknown
default_angle
unknown
figure
Figure
fontfamily or family
{FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'}
fontproperties or font or font_properties
font_manager.FontProperties or str or pathlib.Path
fontsize or size
float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}
fontstretch or stretch
{a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'}
fontstyle or style
{'normal', 'italic', 'oblique'}
fontvariant or variant
{'normal', 'small-caps'}
fontweight or weight
{a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'}
gid
str
horizontalalignment or ha
{'center', 'right', 'left'}
in_layout
bool
label
object
linespacing
float (multiple of font size)
locs_angles_labels
unknown
math_fontfamily
str
multialignment or ma
{'left', 'right', 'center'}
pad
unknown
parse_math
bool
path_effects
AbstractPathEffect
picker
None or bool or float or callable
position
(float, float)
rasterized
bool
rotation
float or {'vertical', 'horizontal'}
rotation_mode
{None, 'default', 'anchor'}
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
text
object
transform
Transform
transform_rotates_text
bool
url
str
usetex
bool or None
verticalalignment or va
{'center', 'top', 'bottom', 'baseline', 'center_baseline'}
visible
bool
wrap
bool
x
float
y
float
zorder
float


Adjust the text angle and text alignment of ticklabels according to the matplotlib convention.
The label_direction must be one of [left, right, bottom, top].
property
left
bottom
right
top
ticklabels angle
90
0
-90
180
ticklabel va
center
baseline
center
baseline
ticklabel ha
right
center
right
center
Note that the text angles are actually relative to (90 + angle of the direction to the ticklabel), which gives 0 for bottom axis.


Bases: mpl_toolkits.axisartist.axis_artist.AttributeCopier, matplotlib.lines.Line2D
Ticks are derived from Line2D, and note that ticks themselves are markers. Thus, you should use set_mec, set_mew, etc.
To change the tick size (length), you need to use set_ticksize. To change the direction of the ticks (ticks are in opposite direction of ticklabels by default), use set_tick_out(False).
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible (Artist.get_visible returns False).
This method is overridden in the Artist subclasses.
Return the line color.
See also set_color.
Return the marker edge color.
See also set_markeredgecolor.
Return the marker edge width in points.
See also set_markeredgewidth.
Return the underlying artist that actually defines some properties (e.g., color) of this artist.
Return whether ticks are drawn inside or outside the axes.
Return length of the ticks in points.
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
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
color or c
unknown
dash_capstyle
CapStyle or {'butt', 'projecting', 'round'}
dash_joinstyle
JoinStyle or {'miter', 'round', 'bevel'}
dashes
sequence of floats (on/off ink in points) or (None, None)
data
(2, N) array or two 1D arrays
drawstyle or ds
{'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default'
figure
Figure
fillstyle
{'full', 'left', 'right', 'bottom', 'top', 'none'}
gid
str
in_layout
bool
label
object
linestyle or ls
{'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw
float
locs_angles
unknown
marker
marker style string, Path or MarkerStyle
markeredgecolor or mec
color
markeredgewidth or mew
float
markerfacecolor or mfc
color
markerfacecoloralt or mfcalt
color
markersize or ms
float
markevery
None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool]
path_effects
AbstractPathEffect
picker
float or callable[[Artist, Event], tuple[bool, dict]]
pickradius
float
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
solid_capstyle
CapStyle or {'butt', 'projecting', 'round'}
solid_joinstyle
JoinStyle or {'miter', 'round', 'bevel'}
tick_out
unknown
ticksize
unknown
transform
Transform
url
str
visible
bool
xdata
1D array
ydata
1D array
zorder
float
Set the color of the line.
Set whether ticks are drawn inside or outside the axes.
Set length of the ticks in points.


Return the line color.
See also set_color.


Return the marker edge color.
See also set_markeredgecolor.


Return the marker edge width in points.
See also set_markeredgewidth.


Return whether ticks are drawn inside or outside the axes.


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
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
color or c
unknown
dash_capstyle
CapStyle or {'butt', 'projecting', 'round'}
dash_joinstyle
JoinStyle or {'miter', 'round', 'bevel'}
dashes
sequence of floats (on/off ink in points) or (None, None)
data
(2, N) array or two 1D arrays
drawstyle or ds
{'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default'
figure
Figure
fillstyle
{'full', 'left', 'right', 'bottom', 'top', 'none'}
gid
str
in_layout
bool
label
object
linestyle or ls
{'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw
float
locs_angles
unknown
marker
marker style string, Path or MarkerStyle
markeredgecolor or mec
color
markeredgewidth or mew
float
markerfacecolor or mfc
color
markerfacecoloralt or mfcalt
color
markersize or ms
float
markevery
None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool]
path_effects
AbstractPathEffect
picker
float or callable[[Artist, Event], tuple[bool, dict]]
pickradius
float
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
solid_capstyle
CapStyle or {'butt', 'projecting', 'round'}
solid_joinstyle
JoinStyle or {'miter', 'round', 'bevel'}
tick_out
unknown
ticksize
unknown
transform
Transform
url
str
visible
bool
xdata
1D array
ydata
1D array
zorder
float


Set whether ticks are drawn inside or outside the axes.


AxislineStyle(stylename, **kw)
A container class which defines style classes for AxisArtists.


Bases: matplotlib.patches._Style
A container class which defines style classes for AxisArtists.
An instance of any axisline style class is an callable object, whose call signature is
When called, this should return an Artist with the following methods:
Return the instance of the subclass with the given style name.
Bases: mpl_toolkits.axisartist.axisline_style.AxislineStyle.SimpleArrow
Size of the arrow as a fraction of the ticklabel size.
alias of mpl_toolkits.axisartist.axisline_style._FancyAxislineStyle.FilledArrow
Bases: mpl_toolkits.axisartist.axisline_style.AxislineStyle._Base
A simple arrow.
Size of the arrow as a fraction of the ticklabel size.
alias of mpl_toolkits.axisartist.axisline_style._FancyAxislineStyle.SimpleArrow


Bases: mpl_toolkits.axisartist.axisline_style.AxislineStyle.SimpleArrow
Size of the arrow as a fraction of the ticklabel size.
alias of mpl_toolkits.axisartist.axisline_style._FancyAxislineStyle.FilledArrow


Bases: mpl_toolkits.axisartist.axisline_style.AxislineStyle._Base
A simple arrow.
Size of the arrow as a fraction of the ticklabel size.
alias of mpl_toolkits.axisartist.axisline_style._FancyAxislineStyle.SimpleArrow


Axislines includes modified implementation of the Axes class. The biggest difference is that the artists responsible for drawing the axis spine, ticks, ticklabels and axis labels are separated out from Matplotlib's Axis class. Originally, this change was motivated to support curvilinear grid. Here are a few reasons that I came up with a new axes class:
In the new axes class, xaxis and yaxis is set to not visible by default, and new set of artist (AxisArtist) are defined to draw axis line, ticks, ticklabels and axis label. Axes.axis attribute serves as a dictionary of these artists, i.e., ax.axis["left"] is a AxisArtist instance responsible to draw left y-axis. The default Axes.axis contains "bottom", "left", "top" and "right".
AxisArtist can be considered as a container artist and has following children artists which will draw ticks, labels, etc.
Note that these are separate artists from matplotlib.axis.Axis, thus most tick-related functions in Matplotlib won't work. For example, color and markerwidth of the ax.axis["bottom"].major_ticks will follow those of Axes.xaxis unless explicitly specified.
In addition to AxisArtist, the Axes will have gridlines attribute, which obviously draws grid lines. The gridlines needs to be separated from the axis as some gridlines can never pass any axis.
Axes(*args[, grid_helper])
Build an Axes in a figure.
AxesZero(*args[, grid_helper])
Build an Axes in a figure.
AxisArtistHelper()
AxisArtistHelper should define following method with given APIs. Note that the first axes argument will be axes attribute of the caller artist.::.
AxisArtistHelperRectlinear()
GridHelperBase()
GridHelperRectlinear(axes)


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.
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.
Return a list of the child Artists of this Artist.
Toggle the gridlines, and optionally set the properties of the lines.
[Deprecated]
Deprecated since version 3.4:
Create and return a new GridlineCollection instance.
which : "major" or "minor" axis : "both", "x" or "y"
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


Return a list of the child Artists of this Artist.


Toggle the gridlines, and optionally set the properties of the lines.


[Deprecated]
Deprecated since version 3.4:


Create and return a new GridlineCollection instance.
which : "major" or "minor" axis : "both", "x" or "y"


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: mpl_toolkits.axisartist.axislines.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.
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
AxisArtistHelper should define following method with given APIs. Note that the first axes argument will be axes attribute of the caller artist.:
Bases: mpl_toolkits.axisartist.axislines.AxisArtistHelper._Base
Helper class for a fixed (in the axes coordinate) axis.
nth_coord = along which coordinate value varies in 2D, nth_coord = 0 -> x axis, nth_coord = 1 -> y axis
Return the label reference position in transAxes.
get_label_transform() returns a transform of (transAxes+offset)
Bases: mpl_toolkits.axisartist.axislines.AxisArtistHelper._Base


Bases: mpl_toolkits.axisartist.axislines.AxisArtistHelper._Base
Helper class for a fixed (in the axes coordinate) axis.
nth_coord = along which coordinate value varies in 2D, nth_coord = 0 -> x axis, nth_coord = 1 -> y axis
Return the label reference position in transAxes.
get_label_transform() returns a transform of (transAxes+offset)


Return the label reference position in transAxes.
get_label_transform() returns a transform of (transAxes+offset)


Bases: object
Bases: mpl_toolkits.axisartist.axislines.AxisArtistHelper.Fixed
nth_coord = along which coordinate value varies in 2D, nth_coord = 0 -> x axis, nth_coord = 1 -> y axis
tick_loc, tick_angle, tick_label
Bases: mpl_toolkits.axisartist.axislines.AxisArtistHelper.Floating
Return the label reference position in transAxes.
get_label_transform() returns a transform of (transAxes+offset)
tick_loc, tick_angle, tick_label


Bases: mpl_toolkits.axisartist.axislines.AxisArtistHelper.Fixed
nth_coord = along which coordinate value varies in 2D, nth_coord = 0 -> x axis, nth_coord = 1 -> y axis
tick_loc, tick_angle, tick_label


Bases: mpl_toolkits.axisartist.axislines.AxisArtistHelper.Floating
Return the label reference position in transAxes.
get_label_transform() returns a transform of (transAxes+offset)
tick_loc, tick_angle, tick_label


Bases: object
Return list of grid lines as a list of paths (list of points).
which : "major" or "minor" axis : "both", "x" or "y"
[Deprecated]
Deprecated since version 3.4:
Create and return a new GridlineCollection instance.
which : "major" or "minor" axis : "both", "x" or "y"
[Deprecated]
Deprecated since version 3.4:


Return list of grid lines as a list of paths (list of points).
which : "major" or "minor" axis : "both", "x" or "y"


Bases: mpl_toolkits.axisartist.axislines.GridHelperBase
Return list of gridline coordinates in data coordinates.
which : "major" or "minor" axis : "both", "x" or "y"


Return list of gridline coordinates in data coordinates.
which : "major" or "minor" axis : "both", "x" or "y"


atan2(dy, dx)
clip(xlines, ylines, x0[, clip, xdir, ydir])
clip_line_to_rect(xline, yline, bbox)


An experimental support for curvilinear grid.
ExtremeFinderFixed(extremes)
This subclass always returns the same bounding box.
FixedAxisArtistHelper(grid_helper, side[, ...])
nth_coord = along which coordinate value varies.
FloatingAxes
alias of mpl_toolkits.axisartist.floating_axes.FloatingAxesHostAxes
FloatingAxesBase(*args, **kwargs)
FloatingAxisArtistHelper(grid_helper, ...[, ...])
nth_coord = along which coordinate value varies.
GridHelperCurveLinear(aux_trans, extremes[, ...])
aux_trans : a transform from the source (curved) coordinate to target (rectilinear) coordinate.
floatingaxes_class_factory(axes_class)


Bases: mpl_toolkits.axisartist.grid_finder.ExtremeFinderSimple
This subclass always returns the same bounding box.
The bounding box that this helper always returns.
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.


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.


Bases: mpl_toolkits.axisartist.grid_helper_curvelinear.FloatingAxisArtistHelper
nth_coord = 0 -> x axis, nth_coord = 1 -> y axis
tick_loc, tick_angle, tick_label, (optionally) tick_label


tick_loc, tick_angle, tick_label, (optionally) tick_label


Bases: object
mpl_toolkits.axisartist.floating_axes features


Bases: mpl_toolkits.axisartist.grid_helper_curvelinear.FloatingAxisArtistHelper
nth_coord = 0 -> x axis, nth_coord = 1 -> y axis


Bases: mpl_toolkits.axisartist.grid_helper_curvelinear.GridHelperCurveLinear
aux_trans : a transform from the source (curved) coordinate to target (rectilinear) coordinate. An instance of MPL's Transform (inverse transform should be defined) or a tuple of two callable objects which defines the transform and its inverse. The callables need take two arguments of array of source coordinates and should return two target coordinates.
e.g., x2, y2 = trans(x1, y1)
[Deprecated] Return (N, 2) array of (x, y) coordinate of the boundary.
Deprecated since version 3.5.
Return v=0, nth=1.
Return list of grid lines as a list of paths (list of points).
which : "major" or "minor" axis : "both", "x" or "y"
mpl_toolkits.axisartist.floating_axes features


[Deprecated] Return (N, 2) array of (x, y) coordinate of the boundary.
Deprecated since version 3.5.


DictFormatter(format_dict[, formatter])
format_dict : dictionary for format strings to be used.
ExtremeFinderSimple(nx, ny)
A helper class to figure out the range of grid lines that need to be drawn.
FixedLocator(locs)
FormatterPrettyPrint([useMathText])
GridFinder(transform[, extreme_finder, ...])
transform : transform from the image coordinate (which will be the transData of the axes to the world coordinate.
MaxNLocator([nbins, steps, trim, integer, ...])


Bases: object
format_dict : dictionary for format strings to be used. formatter : fall-back formatter
factor is ignored if value is found in the dictionary
mpl_toolkits.axisartist.floating_axes features


factor is ignored if value is found in the dictionary


Bases: object
A helper class to figure out the range of grid lines that need to be drawn.
The number of samples in each 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
Demo CurveLinear Grid2
floating_axis demo
Simple Axis Pad


Bases: object
Call self as a function.
mpl_toolkits.axisartist.floating_axes features


Bases: object
transform : transform from the image coordinate (which will be the transData of the axes to the world coordinate.
or transform = (transform_xy, inv_transform_xy)
locator1, locator2 : grid locator for 1st and 2nd axis.
rough number of grids in each direction.


rough number of grids in each direction.


Bases: matplotlib.ticker.MaxNLocator
Maximum number of intervals; one less than max number of ticks. If the string 'auto', the number of bins will be automatically determined based on the length of the axis.
Sequence of nice numbers starting with 1 and ending with 10; e.g., [1, 2, 4, 5, 10], where the values are acceptable tick multiples. i.e. for the example, 20, 40, 60 would be an acceptable set of ticks, as would 0.4, 0.6, 0.8, because they are multiples of 2. However, 30, 60, 90 would not be allowed because 3 does not appear in the list of steps.
If True, ticks will take only integer values, provided at least min_n_ticks integers are found within the view limits.
If True, autoscaling will result in a range symmetric about zero.
Remove edge ticks -- useful for stacked or ganged plots where the upper tick of one axes overlaps with the lower tick of the axes above it, primarily when rcParams["axes.autolimit_mode"] (default: 'data') is 'round_numbers'. If prune=='lower', the smallest tick will be removed. If prune == 'upper', the largest tick will be removed. If prune == 'both', the largest and smallest ticks will be removed. If prune is None, no ticks will be removed.
Relax nbins and integer constraints if necessary to obtain this minimum number of ticks.
Return the locations of the ticks.
axis_direction demo
Demo CurveLinear Grid2
mpl_toolkits.axisartist.floating_axes features
Simple Axis Pad


An experimental support for curvilinear grid.
FixedAxisArtistHelper(grid_helper, side[, ...])
Helper class for a fixed axis.
FloatingAxisArtistHelper(grid_helper, ...[, ...])
nth_coord = along which coordinate value varies.
GridHelperCurveLinear(aux_trans[, ...])
aux_trans : a transform from the source (curved) coordinate to target (rectilinear) coordinate.


Bases: mpl_toolkits.axisartist.axislines.AxisArtistHelper.Fixed
Helper class for a fixed axis.
nth_coord = 0 -> x axis, nth_coord = 1 -> y axis
[Deprecated]
Deprecated since version 3.5:
tick_loc, tick_angle, tick_label


[Deprecated]
Deprecated since version 3.5:


Bases: mpl_toolkits.axisartist.axislines.AxisArtistHelper.Floating
nth_coord = 0 -> x axis, nth_coord = 1 -> y axis
tick_loc, tick_angle, tick_label, (optionally) tick_label


tick_loc, tick_angle, tick_label, (optionally) tick_label


Bases: mpl_toolkits.axisartist.axislines.GridHelperBase
aux_trans : a transform from the source (curved) coordinate to target (rectilinear) coordinate. An instance of MPL's Transform (inverse transform should be defined) or a tuple of two callable objects which defines the transform and its inverse. The callables need take two arguments of array of source coordinates and should return two target coordinates.
e.g., x2, y2 = trans(x1, y1)
Return list of grid lines as a list of paths (list of points).
which : "major" or "minor" axis : "both", "x" or "y"


Return list of grid lines as a list of paths (list of points).
which : "major" or "minor" axis : "both", "x" or "y"


An Anti-Grain Geometry (AGG) backend.
Features that are implemented:
Still TODO:
alias of matplotlib.backends.backend_agg.FigureCanvasAgg
Bases: matplotlib.backend_bases.FigureCanvasBase
Get the image as a memoryview to the renderer's buffer.
draw must be called at least once before this function will work and to update the renderer for any subsequent changes to the Figure.
Render the Figure.
It is important that this method actually walk the artist tree even if not output is produced because this will trigger deferred work (like computing limits auto-limits and tick values) that users may want access to before saving to disk.
Write the figure to a JPEG file.
The file to write to.
Additional keyword arguments that are passed to PIL.Image.Image.save when saving the figure.
Write the figure to a JPEG file.
The file to write to.
Additional keyword arguments that are passed to PIL.Image.Image.save when saving the figure.
Write the figure to a PNG file.
The file to write to.
Metadata in the PNG file as key-value pairs of bytes or latin-1 encodable strings. According to the PNG specification, keys must be shorter than 79 chars.
The PNG specification defines some common keywords that may be used as appropriate:
Other keywords may be invented for other purposes.
If 'Software' is not given, an autogenerated value for Matplotlib will be used. This can be removed by setting it to None.
For more details see the PNG specification.
Keyword arguments passed to PIL.Image.Image.save.
If the 'pnginfo' key is present, it completely overrides metadata, including the default 'Software' key.
Get the image as ARGB bytes.
draw must be called at least once before this function will work and to update the renderer for any subsequent changes to the Figure.
Get the image as RGB bytes.
draw must be called at least once before this function will work and to update the renderer for any subsequent changes to the Figure.
Bases: matplotlib.backend_bases.RendererBase
The renderer handles all the drawing primitives using a graphics context instance that controls the colors/styles
Draw mathtext using matplotlib.mathtext.
Draw a Path instance using the given affine transform.
Draw the text instance.
The graphics context.
The x location of the text in display coords.
The y location of the text baseline in display coords.
The text string.
The font properties.
The rotation angle in degrees anti-clockwise.
The original text object to be rendered.
Note for backend implementers:
When you are trying to determine if you have gotten your bounding box right (which is what enables the text layout/alignment to work properly), it helps to change the line in text.py:
to if 1, and then the actual bounding box will be plotted along with your text.
Return the canvas width and height in display coords.
[Deprecated]
Deprecated since version 3.4:
Get the width, height, and descent (offset from the bottom to the baseline), in display coords, of the string s with FontProperties prop.
Return whether image composition by Matplotlib should be skipped.
Raster backends should usually return False (letting the C-level rasterizer take care of image composition); vector backends should usually return not rcParams["image.composite_image"].
Return whether arbitrary affine transformations in draw_image() are supported (True for most vector backends).
Convert points to display units.
You need to override this function (unless your backend doesn't have a dpi, e.g., postscript or svg). Some imaging systems assume some value for pixels per inch:
a float or a numpy array of float
Restore the saved region. If bbox (instance of BboxBase, or its extents) is given, only the region specified by the bbox will be restored. xy (a pair of floats) optionally specifies the new position (the LLC of the original region, not the LLC of the bbox) where the region will be restored.
Start filtering. It simply create a new canvas (the old one is saved).
Save the plot in the current canvas as a image and apply the post_processing function.
# ny, nx, depth = image.shape # image (numpy array) has RGBA channels and has a depth of 4. ... # create a new_image (numpy array of 4 channels, size can be # different). The resulting image may have offsets from # lower-left corner of the original image return new_image, offset_x, offset_y
The saved renderer is restored and the returned image from post_processing is plotted (using draw_image) on it.
[Deprecated]
Deprecated since version 3.4: