Bases: matplotlib.axes._axes.Axes
A polar graph projection, where the input dimensions are theta, r.
Theta starts pointing east and goes anti-clockwise.
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: matplotlib.transforms.Transform
The inverse of the polar transform, mapping Cartesian coordinate space x and y back to theta and r.
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of str(transform) when DEBUG=True.
True if this transform has a corresponding inverse transform.
The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.
Return the corresponding inverse transformation.
It holds x == self.inverted().transform(self.transform(x)).
The return value of this method should be treated as temporary. An update to self does not cause a corresponding update to its inverted copy.
The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.
Apply only the non-affine part of this transformation.
transform(values) is always equivalent to transform_affine(transform_non_affine(values)).
In non-affine transformations, this is generally equivalent to transform(values). In affine transformations, this is always a no-op.
The input values as NumPy array of length input_dims or shape (N x input_dims).
The output values as NumPy array of length input_dims or shape (N x output_dims), depending on the input.
Bases: matplotlib.transforms.Affine2DBase
The affine part of the polar projection. Scales the output so that maximum radius rests on the edge of the axes circle.
limits is the view limit of the data. The only part of its bounds that is used is the y limits (for the radius limits). The theta range is handled by the non-affine transform.
Get the matrix for the affine part of this transform.
Bases: matplotlib.transforms.Transform
The base polar transform. This handles projection theta and r into Cartesian coordinate space x and y, but does not perform the ultimate affine transformation into the correct position.
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of str(transform) when DEBUG=True.
True if this transform has a corresponding inverse transform.
The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.
Return the corresponding inverse transformation.
It holds x == self.inverted().transform(self.transform(x)).
The return value of this method should be treated as temporary. An update to self does not cause a corresponding update to its inverted copy.
The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.
Apply only the non-affine part of this transformation.
transform(values) is always equivalent to transform_affine(transform_non_affine(values)).
In non-affine transformations, this is generally equivalent to transform(values). In affine transformations, this is always a no-op.
The input values as NumPy array of length input_dims or shape (N x input_dims).
The output values as NumPy array of length input_dims or shape (N x output_dims), depending on the input.
Apply the non-affine part of this transform to Path path, returning a new Path.
transform_path(path) is equivalent to transform_path_affine(transform_path_non_affine(values)).
Bases: matplotlib.ticker.Locator
Used to locate radius ticks.
Ensures that all ticks are strictly positive. For all other tasks, it delegates to the base Locator (which may be different depending on the scale of the r-axis).
Adjust a range as needed to avoid singularities.
This method gets called during autoscaling, with (v0, v1) set to the data limits on the axes if the axes contains any data, or (-inf, +inf) if not.
Select a scale for the range from vmin to vmax.
Subclasses should override this method to change locator behaviour.
Bases: matplotlib.ticker.Formatter
Used to format the theta tick labels. Converts the native unit of radians into degrees and adds a degree symbol.
Bases: matplotlib.ticker.Locator
Used to locate theta ticks.
This will work the same as the base locator except in the case that the view spans the entire circle. In such cases, the previously used default locations of every 45 degrees are returned.
Select a scale for the range from vmin to vmax.
Subclasses should override this method to change locator behaviour.
Return whether this axes supports the pan/zoom button functionality.
For polar axes, this is slightly misleading. Both panning and zooming are performed by the same button. Panning is performed in azimuth while zooming is done along the radial.
Return whether this axes supports the zoom box button functionality.
Polar axes do not support zoom boxes.
Clear the Axes.
Called when the mouse moves during a pan operation.
The pressed mouse button.
The pressed key, if any.
The mouse coordinates in display coords.
This is intended to be overridden by new projection types.
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.
Called when a pan operation completes (when the mouse button is up.)
This is intended to be overridden by new projection types.
Return a format string formatting the x, y coordinates.
Return the aspect ratio of the data itself. For a polar plot, this should always be 1.0
The theta position of the radius labels in degrees.
Outer radial limit.
The inner radial limit.
Get the direction in which theta increases.
Theta increases in the clockwise direction
Theta increases in the counterclockwise direction
Get the offset for the location of 0 in radians.
Return the maximum theta limit in degrees.
Get the minimum theta limit in degrees.
The transform used for drawing x-axis labels, which will add pad_points of padding (in points) between the axis and the label. The x-direction is in data coordinates and the y-direction is in axis coordinates
The text vertical alignment.
The text horizontal alignment.
This transformation is primarily used by the Axis class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations.
The transform used for drawing secondary x-axis labels, which will add pad_points of padding (in points) between the axis and the label. The x-direction is in data coordinates and the y-direction is in axis coordinates
The text vertical alignment.
The text horizontal alignment.
This transformation is primarily used by the Axis class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations.
Get the transformation used for drawing x-axis labels, ticks and gridlines. The x-direction is in data coordinates and the y-direction is in axis coordinates.
Note
This transformation is primarily used by the Axis class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations.
The transform used for drawing y-axis labels, which will add pad_points of padding (in points) between the axis and the label. The x-direction is in axis coordinates and the y-direction is in data coordinates
The text vertical alignment.
The text horizontal alignment.
This transformation is primarily used by the Axis class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations.
The transform used for drawing secondart y-axis labels, which will add pad_points of padding (in points) between the axis and the label. The x-direction is in axis coordinates and the y-direction is in data coordinates
The text vertical alignment.
The text horizontal alignment.
This transformation is primarily used by the Axis class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations.
Get the transformation used for drawing y-axis labels, ticks and gridlines. The x-direction is in axis coordinates and the y-direction is in data coordinates.
Note
This transformation is primarily used by the Axis class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations.
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
rgrids
tuple with floats
rlabel_position
number
rlim
unknown
rmax
float
rmin
float
rorigin
float
rscale
unknown
rticks
unknown
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
theta_direction
unknown
theta_offset
unknown
theta_zero_location
str
thetagrids
tuple with floats, degrees
thetalim
unknown
thetamax
unknown
thetamin
unknown
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
float, optional
ymargin
float greater than -0.5
yscale
unknown
yticklabels
unknown
yticks
unknown
zorder
float
Set the radial gridlines on a polar plot.
The radii for the radial gridlines
The labels to use at each radial gridline. The matplotlib.ticker.ScalarFormatter will be used if None.
The angular position of the radius labels in degrees.
Format string used in matplotlib.ticker.FormatStrFormatter. For example '%f'.
The radial gridlines.
The tick labels.
kwargs are optional Text properties for the labels.
See also
Update the theta position of the radius labels.
The angular position of the radius labels in degrees.
See set_ylim.
Set the outer radial limit.
Set the inner radial limit.
Update the radial origin.
Set the direction in which theta increases.
Theta increases in the clockwise direction
Theta increases in the counterclockwise direction
Set the offset for the location of 0 in radians.
Set the location of theta's zero.
This simply calls set_theta_offset with the correct value in radians.
May be one of "N", "NW", "W", "SW", "S", "SE", "E", or "NE".
An offset in degrees to apply from the specified loc. Note: this offset is always applied counter-clockwise regardless of the direction setting.
Set the theta gridlines in a polar plot.
The angles of the theta gridlines.
The labels to use at each theta gridline. The projections.polar.ThetaFormatter will be used if None.
Format string used in matplotlib.ticker.FormatStrFormatter. For example '%f'. Note that the angle that is used is in radians.
The theta gridlines.
The tick labels.
kwargs are optional Text properties for the labels.
See also
Set the minimum and maximum theta values.
Can take the following signatures:
where minval and maxval are the minimum and maximum limits. Values are wrapped in to the range \([0, 2\pi]\) (in radians), so for example it is possible to do set_thetalim(-np.pi / 2, np.pi / 2) to have an axes symmetric around 0. A ValueError is raised if the absolute angle difference is larger than a full circle.
Set the maximum theta limit in degrees.
Set the minimum theta limit in degrees.
Set the data limits for the radial axis.
The bottom limit (default: None, which leaves the bottom limit unchanged). The bottom and top ylims may be passed as the tuple (bottom, top) as the first positional argument (or as the bottom keyword argument).
The top limit (default: None, which leaves the top limit unchanged).
Whether to notify observers of limit change.
Whether to turn on autoscaling of the y-axis. True turns on, False turns off, None leaves unchanged.
These arguments are deprecated and will be removed in a future version. They are equivalent to bottom and top respectively, and it is an error to pass both ymin and bottom or ymax and top.
The new y-axis limits in data coordinates.
Set the y-axis scale.
The axis scale type to apply.
Different keyword arguments are accepted, depending on the scale. See the respective class keyword arguments:
By default, Matplotlib supports the above mentioned scales. Additionally, custom scales may be registered using matplotlib.scale.register_scale. These scales can then also be used here.
Called when a pan operation has started.
The mouse coordinates in display coords.
The pressed mouse button.
This is intended to be overridden by new projection types.


Return whether this axes supports the pan/zoom button functionality.
For polar axes, this is slightly misleading. Both panning and zooming are performed by the same button. Panning is performed in azimuth while zooming is done along the radial.


Return whether this axes supports the zoom box button functionality.
Polar axes do not support zoom boxes.


Called when the mouse moves during a pan operation.
The pressed mouse button.
The pressed key, if any.
The mouse coordinates in display coords.
This is intended to be overridden by new projection types.


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.


Called when a pan operation completes (when the mouse button is up.)
This is intended to be overridden by new projection types.


Return a format string formatting the x, y coordinates.


Return the aspect ratio of the data itself. For a polar plot, this should always be 1.0


The theta position of the radius labels in degrees.


Get the direction in which theta increases.
Theta increases in the clockwise direction
Theta increases in the counterclockwise direction


Get the offset for the location of 0 in radians.


Return the maximum theta limit in degrees.


The transform used for drawing x-axis labels, which will add pad_points of padding (in points) between the axis and the label. The x-direction is in data coordinates and the y-direction is in axis coordinates
The text vertical alignment.
The text horizontal alignment.
This transformation is primarily used by the Axis class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations.


The transform used for drawing secondary x-axis labels, which will add pad_points of padding (in points) between the axis and the label. The x-direction is in data coordinates and the y-direction is in axis coordinates
The text vertical alignment.
The text horizontal alignment.
This transformation is primarily used by the Axis class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations.


Get the transformation used for drawing x-axis labels, ticks and gridlines. The x-direction is in data coordinates and the y-direction is in axis coordinates.
Note
This transformation is primarily used by the Axis class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations.


The transform used for drawing y-axis labels, which will add pad_points of padding (in points) between the axis and the label. The x-direction is in axis coordinates and the y-direction is in data coordinates
The text vertical alignment.
The text horizontal alignment.
This transformation is primarily used by the Axis class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations.


The transform used for drawing secondart y-axis labels, which will add pad_points of padding (in points) between the axis and the label. The x-direction is in axis coordinates and the y-direction is in data coordinates
The text vertical alignment.
The text horizontal alignment.
This transformation is primarily used by the Axis class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations.


Get the transformation used for drawing y-axis labels, ticks and gridlines. The x-direction is in axis coordinates and the y-direction is in data coordinates.
Note
This transformation is primarily used by the Axis class, and is meant to be overridden by new kinds of projections that may need to place axis elements in different locations.


Bases: matplotlib.transforms.Transform
The inverse of the polar transform, mapping Cartesian coordinate space x and y back to theta and r.
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of str(transform) when DEBUG=True.
True if this transform has a corresponding inverse transform.
The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.
Return the corresponding inverse transformation.
It holds x == self.inverted().transform(self.transform(x)).
The return value of this method should be treated as temporary. An update to self does not cause a corresponding update to its inverted copy.
The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.
Apply only the non-affine part of this transformation.
transform(values) is always equivalent to transform_affine(transform_non_affine(values)).
In non-affine transformations, this is generally equivalent to transform(values). In affine transformations, this is always a no-op.
The input values as NumPy array of length input_dims or shape (N x input_dims).
The output values as NumPy array of length input_dims or shape (N x output_dims), depending on the input.


True if this transform has a corresponding inverse transform.


The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.


Return the corresponding inverse transformation.
It holds x == self.inverted().transform(self.transform(x)).
The return value of this method should be treated as temporary. An update to self does not cause a corresponding update to its inverted copy.


The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.


Apply only the non-affine part of this transformation.
transform(values) is always equivalent to transform_affine(transform_non_affine(values)).
In non-affine transformations, this is generally equivalent to transform(values). In affine transformations, this is always a no-op.
The input values as NumPy array of length input_dims or shape (N x input_dims).
The output values as NumPy array of length input_dims or shape (N x output_dims), depending on the input.


Bases: matplotlib.transforms.Affine2DBase
The affine part of the polar projection. Scales the output so that maximum radius rests on the edge of the axes circle.
limits is the view limit of the data. The only part of its bounds that is used is the y limits (for the radius limits). The theta range is handled by the non-affine transform.
Get the matrix for the affine part of this transform.


Get the matrix for the affine part of this transform.


Bases: matplotlib.transforms.Transform
The base polar transform. This handles projection theta and r into Cartesian coordinate space x and y, but does not perform the ultimate affine transformation into the correct position.
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of str(transform) when DEBUG=True.
True if this transform has a corresponding inverse transform.
The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.
Return the corresponding inverse transformation.
It holds x == self.inverted().transform(self.transform(x)).
The return value of this method should be treated as temporary. An update to self does not cause a corresponding update to its inverted copy.
The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.
Apply only the non-affine part of this transformation.
transform(values) is always equivalent to transform_affine(transform_non_affine(values)).
In non-affine transformations, this is generally equivalent to transform(values). In affine transformations, this is always a no-op.
The input values as NumPy array of length input_dims or shape (N x input_dims).
The output values as NumPy array of length input_dims or shape (N x output_dims), depending on the input.
Apply the non-affine part of this transform to Path path, returning a new Path.
transform_path(path) is equivalent to transform_path_affine(transform_path_non_affine(values)).


Apply the non-affine part of this transform to Path path, returning a new Path.
transform_path(path) is equivalent to transform_path_affine(transform_path_non_affine(values)).


Bases: matplotlib.ticker.Locator
Used to locate radius ticks.
Ensures that all ticks are strictly positive. For all other tasks, it delegates to the base Locator (which may be different depending on the scale of the r-axis).
Adjust a range as needed to avoid singularities.
This method gets called during autoscaling, with (v0, v1) set to the data limits on the axes if the axes contains any data, or (-inf, +inf) if not.
Select a scale for the range from vmin to vmax.
Subclasses should override this method to change locator behaviour.


Adjust a range as needed to avoid singularities.
This method gets called during autoscaling, with (v0, v1) set to the data limits on the axes if the axes contains any data, or (-inf, +inf) if not.


Select a scale for the range from vmin to vmax.
Subclasses should override this method to change locator behaviour.


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
rgrids
tuple with floats
rlabel_position
number
rlim
unknown
rmax
float
rmin
float
rorigin
float
rscale
unknown
rticks
unknown
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
theta_direction
unknown
theta_offset
unknown
theta_zero_location
str
thetagrids
tuple with floats, degrees
thetalim
unknown
thetamax
unknown
thetamin
unknown
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
float, optional
ymargin
float greater than -0.5
yscale
unknown
yticklabels
unknown
yticks
unknown
zorder
float


Set the radial gridlines on a polar plot.
The radii for the radial gridlines
The labels to use at each radial gridline. The matplotlib.ticker.ScalarFormatter will be used if None.
The angular position of the radius labels in degrees.
Format string used in matplotlib.ticker.FormatStrFormatter. For example '%f'.
The radial gridlines.
The tick labels.
kwargs are optional Text properties for the labels.
See also


Update the theta position of the radius labels.
The angular position of the radius labels in degrees.


Set the direction in which theta increases.
Theta increases in the clockwise direction
Theta increases in the counterclockwise direction


Set the offset for the location of 0 in radians.


Set the location of theta's zero.
This simply calls set_theta_offset with the correct value in radians.
May be one of "N", "NW", "W", "SW", "S", "SE", "E", or "NE".
An offset in degrees to apply from the specified loc. Note: this offset is always applied counter-clockwise regardless of the direction setting.


Set the theta gridlines in a polar plot.
The angles of the theta gridlines.
The labels to use at each theta gridline. The projections.polar.ThetaFormatter will be used if None.
Format string used in matplotlib.ticker.FormatStrFormatter. For example '%f'. Note that the angle that is used is in radians.
The theta gridlines.
The tick labels.
kwargs are optional Text properties for the labels.
See also


Set the minimum and maximum theta values.
Can take the following signatures:
where minval and maxval are the minimum and maximum limits. Values are wrapped in to the range \([0, 2\pi]\) (in radians), so for example it is possible to do set_thetalim(-np.pi / 2, np.pi / 2) to have an axes symmetric around 0. A ValueError is raised if the absolute angle difference is larger than a full circle.


Set the data limits for the radial axis.
The bottom limit (default: None, which leaves the bottom limit unchanged). The bottom and top ylims may be passed as the tuple (bottom, top) as the first positional argument (or as the bottom keyword argument).
The top limit (default: None, which leaves the top limit unchanged).
Whether to notify observers of limit change.
Whether to turn on autoscaling of the y-axis. True turns on, False turns off, None leaves unchanged.
These arguments are deprecated and will be removed in a future version. They are equivalent to bottom and top respectively, and it is an error to pass both ymin and bottom or ymax and top.
The new y-axis limits in data coordinates.


Set the y-axis scale.
The axis scale type to apply.
Different keyword arguments are accepted, depending on the scale. See the respective class keyword arguments:
By default, Matplotlib supports the above mentioned scales. Additionally, custom scales may be registered using matplotlib.scale.register_scale. These scales can then also be used here.


Called when a pan operation has started.
The mouse coordinates in display coords.
The pressed mouse button.
This is intended to be overridden by new projection types.


Bases: matplotlib.ticker.Formatter
Used to format the theta tick labels. Converts the native unit of radians into degrees and adds a degree symbol.


Bases: matplotlib.ticker.Locator
Used to locate theta ticks.
This will work the same as the base locator except in the case that the view spans the entire circle. In such cases, the previously used default locations of every 45 degrees are returned.
Select a scale for the range from vmin to vmax.
Subclasses should override this method to change locator behaviour.


Bases: matplotlib.transforms.Transform
The base polar transform. This handles projection theta and r into Cartesian coordinate space x and y, but does not perform the ultimate affine transformation into the correct position.
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of str(transform) when DEBUG=True.
True if this transform has a corresponding inverse transform.
The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.
Return the corresponding inverse transformation.
It holds x == self.inverted().transform(self.transform(x)).
The return value of this method should be treated as temporary. An update to self does not cause a corresponding update to its inverted copy.
The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.
Apply only the non-affine part of this transformation.
transform(values) is always equivalent to transform_affine(transform_non_affine(values)).
In non-affine transformations, this is generally equivalent to transform(values). In affine transformations, this is always a no-op.
The input values as NumPy array of length input_dims or shape (N x input_dims).
The output values as NumPy array of length input_dims or shape (N x output_dims), depending on the input.
Apply the non-affine part of this transform to Path path, returning a new Path.
transform_path(path) is equivalent to transform_path_affine(transform_path_non_affine(values)).


True if this transform has a corresponding inverse transform.


The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.


Return the corresponding inverse transformation.
It holds x == self.inverted().transform(self.transform(x)).
The return value of this method should be treated as temporary. An update to self does not cause a corresponding update to its inverted copy.


The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.


Apply only the non-affine part of this transformation.
transform(values) is always equivalent to transform_affine(transform_non_affine(values)).
In non-affine transformations, this is generally equivalent to transform(values). In affine transformations, this is always a no-op.
The input values as NumPy array of length input_dims or shape (N x input_dims).
The output values as NumPy array of length input_dims or shape (N x output_dims), depending on the input.


Apply the non-affine part of this transform to Path path, returning a new Path.
transform_path(path) is equivalent to transform_path_affine(transform_path_non_affine(values)).


Bases: matplotlib.axis.YAxis
A radial Axis.
This overrides certain properties of a YAxis to provide special-casing for a radial axis.
The Axes to which the created Axis belongs.
The acceptance radius for containment tests. See also Axis.contains.
Read-only name identifying the axis.
[Deprecated]
Deprecated since version 3.4:
Clear the axis.
This resets axis properties to their default values:
Set multiple properties at once.
Supported properties are
Property
Description
agg_filter
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha
scalar or None
animated
bool
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
data_interval
unknown
figure
Figure
gid
str
in_layout
bool
inverted
unknown
label
object
label_coords
unknown
label_position
{'left', 'right'}
label_text
str
major_formatter
Formatter, str, or function
major_locator
Locator
minor_formatter
Formatter, str, or function
minor_locator
Locator
offset_position
{'left', 'right'}
path_effects
AbstractPathEffect
picker
None or bool or float or callable
pickradius
float
rasterized
bool
remove_overlapping_locs
unknown
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
tick_params
unknown
ticklabels
sequence of str or of Texts
ticks
list of floats
ticks_position
{'left', 'right', 'both', 'default', 'none'}
transform
Transform
units
units tag
url
str
view_interval
unknown
visible
bool
zorder
float


[Deprecated]
Deprecated since version 3.4:


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


Set multiple properties at once.
Supported properties are
Property
Description
agg_filter
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha
scalar or None
animated
bool
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
data_interval
unknown
figure
Figure
gid
str
in_layout
bool
inverted
unknown
label
object
label_coords
unknown
label_position
{'left', 'right'}
label_text
str
major_formatter
Formatter, str, or function
major_locator
Locator
minor_formatter
Formatter, str, or function
minor_locator
Locator
offset_position
{'left', 'right'}
path_effects
AbstractPathEffect
picker
None or bool or float or callable
pickradius
float
rasterized
bool
remove_overlapping_locs
unknown
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
tick_params
unknown
ticklabels
sequence of str or of Texts
ticks
list of floats
ticks_position
{'left', 'right', 'both', 'default', 'none'}
transform
Transform
units
units tag
url
str
view_interval
unknown
visible
bool
zorder
float


Bases: matplotlib.ticker.Locator
Used to locate radius ticks.
Ensures that all ticks are strictly positive. For all other tasks, it delegates to the base Locator (which may be different depending on the scale of the r-axis).
Adjust a range as needed to avoid singularities.
This method gets called during autoscaling, with (v0, v1) set to the data limits on the axes if the axes contains any data, or (-inf, +inf) if not.
Select a scale for the range from vmin to vmax.
Subclasses should override this method to change locator behaviour.


Adjust a range as needed to avoid singularities.
This method gets called during autoscaling, with (v0, v1) set to the data limits on the axes if the axes contains any data, or (-inf, +inf) if not.


Select a scale for the range from vmin to vmax.
Subclasses should override this method to change locator behaviour.


Bases: matplotlib.axis.YTick
A radial-axis tick.
This subclass of YTick provides radial ticks with some small modification to their re-positioning such that ticks are rotated based on axes limits. This results in ticks that are correctly perpendicular to the spine. Labels are also rotated to be perpendicular to the spine, when 'auto' rotation is enabled.
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
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
str
label1
str
label2
str
pad
float
path_effects
AbstractPathEffect
picker
None or bool or float or callable
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
transform
Transform
url
str
visible
bool
zorder
float
Set the location of tick in data coords with scalar 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
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
figure
Figure
gid
str
in_layout
bool
label
str
label1
str
label2
str
pad
float
path_effects
AbstractPathEffect
picker
None or bool or float or callable
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
transform
Transform
url
str
visible
bool
zorder
float


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


Bases: matplotlib.axis.XAxis
A theta Axis.
This overrides certain properties of an XAxis to provide special-casing for an angular axis.
The Axes to which the created Axis belongs.
The acceptance radius for containment tests. See also Axis.contains.
Read-only name identifying the axis.
[Deprecated]
Deprecated since version 3.4:
Clear the axis.
This resets axis properties to their default values:
Set multiple properties at once.
Supported properties are
Property
Description
agg_filter
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha
scalar or None
animated
bool
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
data_interval
unknown
figure
Figure
gid
str
in_layout
bool
inverted
unknown
label
object
label_coords
unknown
label_position
{'top', 'bottom'}
label_text
str
major_formatter
Formatter, str, or function
major_locator
Locator
minor_formatter
Formatter, str, or function
minor_locator
Locator
path_effects
AbstractPathEffect
picker
None or bool or float or callable
pickradius
float
rasterized
bool
remove_overlapping_locs
unknown
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
tick_params
unknown
ticklabels
sequence of str or of Texts
ticks
list of floats
ticks_position
{'top', 'bottom', 'both', 'default', 'none'}
transform
Transform
units
units tag
url
str
view_interval
unknown
visible
bool
zorder
float


Set multiple properties at once.
Supported properties are
Property
Description
agg_filter
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha
scalar or None
animated
bool
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
data_interval
unknown
figure
Figure
gid
str
in_layout
bool
inverted
unknown
label
object
label_coords
unknown
label_position
{'top', 'bottom'}
label_text
str
major_formatter
Formatter, str, or function
major_locator
Locator
minor_formatter
Formatter, str, or function
minor_locator
Locator
path_effects
AbstractPathEffect
picker
None or bool or float or callable
pickradius
float
rasterized
bool
remove_overlapping_locs
unknown
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
tick_params
unknown
ticklabels
sequence of str or of Texts
ticks
list of floats
ticks_position
{'top', 'bottom', 'both', 'default', 'none'}
transform
Transform
units
units tag
url
str
view_interval
unknown
visible
bool
zorder
float


Bases: matplotlib.ticker.Formatter
Used to format the theta tick labels. Converts the native unit of radians into degrees and adds a degree symbol.


Bases: matplotlib.ticker.Locator
Used to locate theta ticks.
This will work the same as the base locator except in the case that the view spans the entire circle. In such cases, the previously used default locations of every 45 degrees are returned.
Select a scale for the range from vmin to vmax.
Subclasses should override this method to change locator behaviour.


Bases: matplotlib.axis.XTick
A theta-axis tick.
This subclass of XTick provides angular ticks with some small modification to their re-positioning such that ticks are rotated based on tick location. This results in ticks that are correctly perpendicular to the arc spine.
When 'auto' rotation is enabled, labels are also rotated to be parallel to the spine. The label padding is also applied here since it's not possible to use a generic axes transform to produce tick-specific padding.
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
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
str
label1
str
label2
str
pad
float
path_effects
AbstractPathEffect
picker
None or bool or float or callable
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
transform
Transform
url
str
visible
bool
zorder
float
Set the location of tick in data coords with scalar loc.


Bases: object
A mapping of registered projection names to projection classes.
Get a projection class from its name.
Return the names of all projections currently registered.
Register a new set of projections.


Return the names of all projections currently registered.


matplotlib.pyplot is a state-based interface to matplotlib. It provides an implicit, MATLAB-like, way of plotting. It also opens figures on your screen, and acts as the figure GUI manager.
pyplot is mainly intended for interactive plots and simple cases of programmatic plot generation:
The explicit (object-oriented) API is recommended for complex plots, though pyplot is still usually used to create the figure and often the axes in the figure. See pyplot.figure, pyplot.subplots, and pyplot.subplot_mosaic to create figures, and Axes API for the plotting methods on an axes:
acorr(x, *[, data])
Plot the autocorrelation of x.
angle_spectrum(x[, Fs, Fc, window, pad_to, ...])
Plot the angle spectrum.
annotate(text, xy, *args, **kwargs)
Annotate the point xy with text text.
arrow(x, y, dx, dy, **kwargs)
Add an arrow to the Axes.
autoscale([enable, axis, tight])
Autoscale the axis view to the data (toggle).
autumn()
Set the colormap to 'autumn'.
axes([arg])
Add an axes to the current figure and make it the current axes.
axhline([y, xmin, xmax])
Add a horizontal line across the axis.
axhspan(ymin, ymax[, xmin, xmax])
Add a horizontal span (rectangle) across the Axes.
axis(*args[, emit])
Convenience method to get or set some axis properties.
axline(xy1[, xy2, slope])
Add an infinitely long straight line.
axvline([x, ymin, ymax])
Add a vertical line across the Axes.
axvspan(xmin, xmax[, ymin, ymax])
Add a vertical span (rectangle) across the Axes.
bar(x, height[, width, bottom, align, data])
Make a bar plot.
bar_label(container[, labels, fmt, ...])
Label a bar plot.
barbs(*args[, data])
Plot a 2D field of barbs.
barh(y, width[, height, left, align])
Make a horizontal bar plot.
bone()
Set the colormap to 'bone'.
box([on])
Turn the axes box on or off on the current axes.
boxplot(x[, notch, sym, vert, whis, ...])
Draw a box and whisker plot.
broken_barh(xranges, yrange, *[, data])
Plot a horizontal sequence of rectangles.
cla()
Clear the current axes.
clabel(CS[, levels])
Label a contour plot.
clf()
Clear the current figure.
clim([vmin, vmax])
Set the color limits of the current image.
close([fig])
Close a figure window.
cohere(x, y[, NFFT, Fs, Fc, detrend, ...])
Plot the coherence between x and y.
colorbar([mappable, cax, ax])
Add a colorbar to a plot.
connect(s, func)
Bind function func to event s.
contour(*args[, data])
Plot contour lines.
contourf(*args[, data])
Plot filled contours.
cool()
Set the colormap to 'cool'.
copper()
Set the colormap to 'copper'.
csd(x, y[, NFFT, Fs, Fc, detrend, window, ...])
Plot the cross-spectral density.
delaxes([ax])
Remove an Axes (defaulting to the current axes) from its figure.
disconnect(cid)
Disconnect the callback with id cid.
draw()
Redraw the current figure.
draw_if_interactive()
Redraw the current figure if in interactive mode.
errorbar(x, y[, yerr, xerr, fmt, ecolor, ...])
Plot y versus x as lines and/or markers with attached errorbars.
eventplot(positions[, orientation, ...])
Plot identical parallel lines at the given positions.
figimage(X[, xo, yo, alpha, norm, cmap, ...])
Add a non-resampled image to the figure.
figlegend(*args, **kwargs)
Place a legend on the figure.
fignum_exists(num)
Return whether the figure with the given id exists.
figtext(x, y, s[, fontdict])
Add text to figure.
figure([num, figsize, dpi, facecolor, ...])
Create a new figure, or activate an existing figure.
fill(*args[, data])
Plot filled polygons.
fill_between(x, y1[, y2, where, ...])
Fill the area between two horizontal curves.
fill_betweenx(y, x1[, x2, where, step, ...])
Fill the area between two vertical curves.
findobj([o, match, include_self])
Find artist objects.
flag()
Set the colormap to 'flag'.
gca(**kwargs)
Get the current Axes.
gcf()
Get the current figure.
gci()
Get the current colorable artist.
get(obj, *args, **kwargs)
Return the value of an Artist's property, or print all of them.
get_current_fig_manager()
Return the figure manager of the current figure.
get_figlabels()
Return a list of existing figure labels.
get_fignums()
Return a list of existing figure numbers.
get_plot_commands()
Get a sorted list of all of the plotting commands.
getp(obj, *args, **kwargs)
Return the value of an Artist's property, or print all of them.
ginput([n, timeout, show_clicks, mouse_add, ...])
Blocking call to interact with a figure.
gray()
Set the colormap to 'gray'.
grid([visible, which, axis])
Configure the grid lines.
hexbin(x, y[, C, gridsize, bins, xscale, ...])
Make a 2D hexagonal binning plot of points x, y.
hist(x[, bins, range, density, weights, ...])
Plot a histogram.
hist2d(x, y[, bins, range, density, ...])
Make a 2D histogram plot.
hlines(y, xmin, xmax[, colors, linestyles, ...])
Plot horizontal lines at each y from xmin to xmax.
hot()
Set the colormap to 'hot'.
hsv()
Set the colormap to 'hsv'.
imread(fname[, format])
Read an image from a file into an array.
imsave(fname, arr, **kwargs)
Save an array as an image file.
imshow(X[, cmap, norm, aspect, ...])
Display data as an image, i.e., on a 2D regular raster.
inferno()
Set the colormap to 'inferno'.
install_repl_displayhook()
Install a repl display hook so that any stale figure are automatically redrawn when control is returned to the repl.
ioff()
Disable interactive mode.
ion()
Enable interactive mode.
isinteractive()
Return whether plots are updated after every plotting command.
jet()
Set the colormap to 'jet'.
legend(*args, **kwargs)
Place a legend on the Axes.
locator_params([axis, tight])
Control behavior of major tick locators.
loglog(*args, **kwargs)
Make a plot with log scaling on both the x and y axis.
magma()
Set the colormap to 'magma'.
magnitude_spectrum(x[, Fs, Fc, window, ...])
Plot the magnitude spectrum.
margins(*margins[, x, y, tight])
Set or retrieve autoscaling margins.
matshow(A[, fignum])
Display an array as a matrix in a new figure window.
minorticks_off()
Remove minor ticks from the Axes.
minorticks_on()
Display minor ticks on the Axes.
new_figure_manager(num, *args, **kwargs)
Create a new figure manager instance.
nipy_spectral()
Set the colormap to 'nipy_spectral'.
pause(interval)
Run the GUI event loop for interval seconds.
pcolor(*args[, shading, alpha, norm, cmap, ...])
Create a pseudocolor plot with a non-regular rectangular grid.
pcolormesh(*args[, alpha, norm, cmap, vmin, ...])
Create a pseudocolor plot with a non-regular rectangular grid.
phase_spectrum(x[, Fs, Fc, window, pad_to, ...])
Plot the phase spectrum.
pie(x[, explode, labels, colors, autopct, ...])
Plot a pie chart.
pink()
Set the colormap to 'pink'.
plasma()
Set the colormap to 'plasma'.
plot(*args[, scalex, scaley, data])
Plot y versus x as lines and/or markers.
plot_date(x, y[, fmt, tz, xdate, ydate, data])
Plot coercing the axis to treat floats as dates.
polar(*args, **kwargs)
Make a polar plot.
prism()
Set the colormap to 'prism'.
psd(x[, NFFT, Fs, Fc, detrend, window, ...])
Plot the power spectral density.
quiver(*args[, data])
Plot a 2D field of arrows.
quiverkey(Q, X, Y, U, label, **kwargs)
Add a key to a quiver plot.
rc(group, **kwargs)
Set the current rcParams. group is the grouping for the rc, e.g., for lines.linewidth the group is lines, for axes.facecolor, the group is axes, and so on. Group may also be a list or tuple of group names, e.g., (xtick, ytick). kwargs is a dictionary attribute name/value pairs, e.g.,::.
rc_context([rc, fname])
Return a context manager for temporarily changing rcParams.
rcdefaults()
Restore the rcParams from Matplotlib's internal default style.
rgrids([radii, labels, angle, fmt])
Get or set the radial gridlines on the current polar plot.
savefig(*args, **kwargs)
Save the current figure.
sca(ax)
Set the current Axes to ax and the current Figure to the parent of ax.
scatter(x, y[, s, c, marker, cmap, norm, ...])
A scatter plot of y vs.
sci(im)
Set the current image.
semilogx(*args, **kwargs)
Make a plot with log scaling on the x axis.
semilogy(*args, **kwargs)
Make a plot with log scaling on the y axis.
set_cmap(cmap)
Set the default colormap, and applies it to the current image if any.
set_loglevel(*args, **kwargs)
Set Matplotlib's root logger and root logger handler level, creating the handler if it does not exist yet.
setp(obj, *args, **kwargs)
Set one or more properties on an Artist, or list allowed values.
show(*[, block])
Display all open figures.
specgram(x[, NFFT, Fs, Fc, detrend, window, ...])
Plot a spectrogram.
spring()
Set the colormap to 'spring'.
spy(Z[, precision, marker, markersize, ...])
Plot the sparsity pattern of a 2D array.
stackplot(x, *args[, labels, colors, ...])
Draw a stacked area plot.
stairs(values[, edges, orientation, ...])
A stepwise constant function as a line with bounding edges or a filled plot.
stem(*args[, linefmt, markerfmt, basefmt, ...])
Create a stem plot.
step(x, y, *args[, where, data])
Make a step plot.
streamplot(x, y, u, v[, density, linewidth, ...])
Draw streamlines of a vector flow.
subplot(*args, **kwargs)
Add an Axes to the current figure or retrieve an existing Axes.
subplot2grid(shape, loc[, rowspan, colspan, fig])
Create a subplot at a specific location inside a regular grid.
subplot_mosaic(mosaic, *[, sharex, sharey, ...])
Build a layout of Axes based on ASCII art or nested lists.
subplot_tool([targetfig])
Launch a subplot tool window for a figure.
subplots([nrows, ncols, sharex, sharey, ...])
Create a figure and a set of subplots.
subplots_adjust([left, bottom, right, top, ...])
Adjust the subplot layout parameters.
summer()
Set the colormap to 'summer'.
suptitle(t, **kwargs)
Add a centered suptitle to the figure.
switch_backend(newbackend)
Close all open figures and set the Matplotlib backend.
table([cellText, cellColours, cellLoc, ...])
Add a table to an Axes.
text(x, y, s[, fontdict])
Add text to the Axes.
thetagrids([angles, labels, fmt])
Get or set the theta gridlines on the current polar plot.
tick_params([axis])
Change the appearance of ticks, tick labels, and gridlines.
ticklabel_format(*[, axis, style, ...])
Configure the ScalarFormatter used by default for linear axes.
tight_layout(*[, pad, h_pad, w_pad, rect])
Adjust the padding between and around subplots.
title(label[, fontdict, loc, pad, y])
Set a title for the Axes.
tricontour(*args, **kwargs)
Draw contour lines on an unstructured triangular grid.
tricontourf(*args, **kwargs)
Draw contour regions on an unstructured triangular grid.
tripcolor(*args[, alpha, norm, cmap, vmin, ...])
Create a pseudocolor plot of an unstructured triangular grid.
triplot(*args, **kwargs)
Draw a unstructured triangular grid as lines and/or markers.
twinx([ax])
Make and return a second axes that shares the x-axis.
twiny([ax])
Make and return a second axes that shares the y-axis.
uninstall_repl_displayhook()
Uninstall the Matplotlib display hook.
violinplot(dataset[, positions, vert, ...])
Make a violin plot.
viridis()
Set the colormap to 'viridis'.
vlines(x, ymin, ymax[, colors, linestyles, ...])
Plot vertical lines at each x from ymin to ymax.
waitforbuttonpress([timeout])
Blocking call to interact with the figure.
winter()
Set the colormap to 'winter'.
xcorr(x, y[, normed, detrend, usevlines, ...])
Plot the cross correlation between x and y.
xkcd([scale, length, randomness])
Turn on xkcd sketch-style drawing mode.
xlabel(xlabel[, fontdict, labelpad, loc])
Set the label for the x-axis.
xlim(*args, **kwargs)
Get or set the x limits of the current axes.
xscale(value, **kwargs)
Set the x-axis scale.
xticks([ticks, labels])
Get or set the current tick locations and labels of the x-axis.
ylabel(ylabel[, fontdict, labelpad, loc])
Set the label for the y-axis.
ylim(*args, **kwargs)
Get or set the y-limits of the current axes.
yscale(value, **kwargs)
Set the y-axis scale.
yticks([ticks, labels])
Get or set the current tick locations and labels of the y-axis.


pyplot
matplotlib.pyplot is a state-based interface to matplotlib.
Function
Description
acorr
Plot the autocorrelation of x.
angle_spectrum
Plot the angle spectrum.
annotate
Annotate the point xy with text text.
arrow
Add an arrow to the Axes.
autoscale
Autoscale the axis view to the data (toggle).
axes
Add an axes to the current figure and make it the current axes.
axhline
Add a horizontal line across the axis.
axhspan
Add a horizontal span (rectangle) across the Axes.
axis
Convenience method to get or set some axis properties.
axline
Add an infinitely long straight line.
axvline
Add a vertical line across the Axes.
axvspan
Add a vertical span (rectangle) across the Axes.
bar
Make a bar plot.
bar_label
Label a bar plot.
barbs
Plot a 2D field of barbs.
barh
Make a horizontal bar plot.
box
Turn the axes box on or off on the current axes.
boxplot
Draw a box and whisker plot.
broken_barh
Plot a horizontal sequence of rectangles.
cla
Clear the current axes.
clabel
Label a contour plot.
clf
Clear the current figure.
clim
Set the color limits of the current image.
close
Close a figure window.
cohere
Plot the coherence between x and y.
colorbar
Add a colorbar to a plot.
contour
Plot contour lines.
contourf
Plot filled contours.
csd
Plot the cross-spectral density.
delaxes
Remove an Axes (defaulting to the current axes) from its figure.
draw
Redraw the current figure.
draw_if_interactive
Redraw the current figure if in interactive mode.
errorbar
Plot y versus x as lines and/or markers with attached errorbars.
eventplot
Plot identical parallel lines at the given positions.
figimage
Add a non-resampled image to the figure.
figlegend
Place a legend on the figure.
fignum_exists
Return whether the figure with the given id exists.
figtext
Add text to figure.
figure
Create a new figure, or activate an existing figure.
fill
Plot filled polygons.
fill_between
Fill the area between two horizontal curves.
fill_betweenx
Fill the area between two vertical curves.
findobj
Find artist objects.
gca
Get the current Axes.
gcf
Get the current figure.
gci
Get the current colorable artist.
get
Return the value of an Artist's property, or print all of them.
get_figlabels
Return a list of existing figure labels.
get_fignums
Return a list of existing figure numbers.
getp
Return the value of an Artist's property, or print all of them.
grid
Configure the grid lines.
hexbin
Make a 2D hexagonal binning plot of points x, y.
hist
Plot a histogram.
hist2d
Make a 2D histogram plot.
hlines
Plot horizontal lines at each y from xmin to xmax.
imread
Read an image from a file into an array.
imsave
Save an array as an image file.
imshow
Display data as an image, i.e., on a 2D regular raster.
install_repl_displayhook
Install a repl display hook so that any stale figure are automatically redrawn when control is returned to the repl.
ioff
Disable interactive mode.
ion
Enable interactive mode.
isinteractive
Return whether plots are updated after every plotting command.
legend
Place a legend on the Axes.
locator_params
Control behavior of major tick locators.
loglog
Make a plot with log scaling on both the x and y axis.
magnitude_spectrum
Plot the magnitude spectrum.
margins
Set or retrieve autoscaling margins.
matshow
Display an array as a matrix in a new figure window.
minorticks_off
Remove minor ticks from the Axes.
minorticks_on
Display minor ticks on the Axes.
new_figure_manager
Create a new figure manager instance.
pause
Run the GUI event loop for interval seconds.
pcolor
Create a pseudocolor plot with a non-regular rectangular grid.
pcolormesh
Create a pseudocolor plot with a non-regular rectangular grid.
phase_spectrum
Plot the phase spectrum.
pie
Plot a pie chart.
plot
Plot y versus x as lines and/or markers.
plot_date
Plot coercing the axis to treat floats as dates.
polar
Make a polar plot.
psd
Plot the power spectral density.
quiver
Plot a 2D field of arrows.
quiverkey
Add a key to a quiver plot.
rc
Set the current rcParams.
rc_context
Return a context manager for temporarily changing rcParams.
rcdefaults
Restore the rcParams from Matplotlib's internal default style.
rgrids
Get or set the radial gridlines on the current polar plot.
savefig
Save the current figure.
sca
Set the current Axes to ax and the current Figure to the parent of ax.
scatter
A scatter plot of y vs.
sci
Set the current image.
semilogx
Make a plot with log scaling on the x axis.
semilogy
Make a plot with log scaling on the y axis.
set_cmap
Set the default colormap, and applies it to the current image if any.
set_loglevel
Set Matplotlib's root logger and root logger handler level, creating the handler if it does not exist yet.
setp
Set one or more properties on an Artist, or list allowed values.
show
Display all open figures.
specgram
Plot a spectrogram.
spy
Plot the sparsity pattern of a 2D array.
stackplot
Draw a stacked area plot.
stairs
A stepwise constant function as a line with bounding edges or a filled plot.
stem
Create a stem plot.
step
Make a step plot.
streamplot
Draw streamlines of a vector flow.
subplot
Add an Axes to the current figure or retrieve an existing Axes.
subplot2grid
Create a subplot at a specific location inside a regular grid.
subplot_mosaic
Build a layout of Axes based on ASCII art or nested lists.
subplot_tool
Launch a subplot tool window for a figure.
subplots
Create a figure and a set of subplots.
subplots_adjust
Adjust the subplot layout parameters.
suptitle
Add a centered suptitle to the figure.
switch_backend
Close all open figures and set the Matplotlib backend.
table
Add a table to an Axes.
text
Add text to the Axes.
thetagrids
Get or set the theta gridlines on the current polar plot.
tick_params
Change the appearance of ticks, tick labels, and gridlines.
ticklabel_format
Configure the ScalarFormatter used by default for linear axes.
tight_layout
Adjust the padding between and around subplots.
title
Set a title for the Axes.
tricontour
Draw contour lines on an unstructured triangular grid.
tricontourf
Draw contour regions on an unstructured triangular grid.
tripcolor
Create a pseudocolor plot of an unstructured triangular grid.
triplot
Draw a unstructured triangular grid as lines and/or markers.
twinx
Make and return a second axes that shares the x-axis.
twiny
Make and return a second axes that shares the y-axis.
uninstall_repl_displayhook
Uninstall the Matplotlib display hook.
violinplot
Make a violin plot.
vlines
Plot vertical lines at each x from ymin to ymax.
xcorr
Plot the cross correlation between x and y.
xkcd
Turn on xkcd sketch-style drawing mode.
xlabel
Set the label for the x-axis.
xlim
Get or set the x limits of the current axes.
xscale
Set the x-axis scale.
xticks
Get or set the current tick locations and labels of the x-axis.
ylabel
Set the label for the y-axis.
ylim
Get or set the y-limits of the current axes.
yscale
Set the y-axis scale.
yticks
Get or set the current tick locations and labels of the y-axis.
There are many colormaps you can use to map data onto color values. Below we list several ways in which color can be utilized in Matplotlib.
For a more in-depth look at colormaps, see the Choosing Colormaps in Matplotlib tutorial.
Container for colormaps that are known to Matplotlib by name.
Experimental
While we expect the API to be final, we formally mark it as experimental for 3.5 because we want to keep the option to still adapt the API for 3.6 should the need arise.
The universal registry instance is matplotlib.colormaps. There should be no need for users to instantiate ColormapRegistry themselves.
Read access uses a dict-like interface mapping names to Colormaps:
Returned Colormaps are copies, so that their modification does not change the global definition of the colormap.
Additional colormaps can be added via ColormapRegistry.register:


Plot the autocorrelation of x.
A detrending function applied to x. 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 acorr value using Axes.vlines. Additionally, a horizontal line is plotted at y=0 using Axes.axhline.
If False, markers are plotted at the acorr 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
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".


Plot the angle spectrum.
Compute the angle spectrum (wrapped phase spectrum) of x. Data is padded to a length of pad_to and the windowing function window is applied to the signal.
Array or sequence containing the data.
The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit.
A function or a vector of length NFFT. To create window vectors see window_hanning, window_none, numpy.blackman, numpy.hamming, numpy.bartlett, scipy.signal, scipy.signal.get_window, etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment.
Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided.
The number of points to which the data segment is padded when performing the FFT. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the n parameter in the call to fft(). The default is None, which sets pad_to equal to the length of the input signal (i.e. no padding).
The center frequency of x, which offsets the x extents of the plot to reflect the frequency range used when a signal is acquired and then filtered and downsampled to baseband.
The values for the angle spectrum in radians (real valued).
The frequencies corresponding to the elements in spectrum.
The line created by this function.
If given, the following parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception):
x
Keyword arguments control the Line2D properties:
Property
Description
agg_filter
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha
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
color
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
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'}
transform
unknown
url
str
visible
bool
xdata
1D array
ydata
1D array
zorder
float
See also
Plots the magnitudes of the corresponding frequencies.
Plots the unwrapped version of this function.
Can plot the angle spectrum of segments within the signal in a colormap.


Annotate the point xy with text text.
In the simplest form, the text is placed at xy.
Optionally, the text can be displayed in another position xytext. An arrow pointing from the text to the annotated point xy can then be added by defining arrowprops.
The text of the annotation.
The point (x, y) to annotate. The coordinate system is determined by xycoords.
The position (x, y) to place the text at. The coordinate system is determined by textcoords.
The coordinate system that xy is given in. The following types of values are supported:
One of the following strings:
Value
Description
'figure points'
Points from the lower left of the figure
'figure pixels'
Pixels from the lower left of the figure
'figure fraction'
Fraction of figure from lower left
'subfigure points'
Points from the lower left of the subfigure
'subfigure pixels'
Pixels from the lower left of the subfigure
'subfigure fraction'
Fraction of subfigure from lower left
'axes points'
Points from lower left corner of axes
'axes pixels'
Pixels from lower left corner of axes
'axes fraction'
Fraction of axes from lower left
'data'
Use the coordinate system of the object being annotated (default)
'polar'
(theta, r) if not native 'data' coordinates
Note that 'subfigure pixels' and 'figure pixels' are the same for the parent figure, so users who want code that is usable in a subfigure can use 'subfigure pixels'.
A function with one of the following signatures:
where renderer is a RendererBase subclass.
The result of the function is interpreted like the Artist and Transform cases above.
See Advanced Annotations for more details.
The coordinate system that xytext is given in.
All xycoords values are valid as well as the following strings:
Value
Description
'offset points'
Offset (in points) from the xy value
'offset pixels'
Offset (in pixels) from the xy value
The properties used to draw a FancyArrowPatch arrow between the positions xy and xytext. Defaults to None, i.e. no arrow is drawn.
For historical reasons there are two different ways to specify arrows, "simple" and "fancy":
Simple arrow:
If arrowprops does not contain the key 'arrowstyle' the allowed keys are:
Key
Description
width
The width of the arrow in points
headwidth
The width of the base of the arrow head in points
headlength
The length of the arrow head in points
shrink
Fraction of total length to shrink from both ends
?
Any key to matplotlib.patches.FancyArrowPatch
The arrow is attached to the edge of the text box, the exact position (corners or centers) depending on where it's pointing to.
Fancy arrow:
This is used if 'arrowstyle' is provided in the arrowprops.
Valid keys are the following FancyArrowPatch parameters:
Key
Description
arrowstyle
the arrow style
connectionstyle
the connection style
relpos
see below; default is (0.5, 0.5)
patchA
default is bounding box of the text
patchB
default is None
shrinkA
default is 2 points
shrinkB
default is 2 points
mutation_scale
default is text size (in points)
mutation_aspect
default is 1.
?
any key for matplotlib.patches.PathPatch
The exact starting point position of the arrow is defined by relpos. It's a tuple of relative coordinates of the text box, where (0, 0) is the lower left corner and (1, 1) is the upper right corner. Values <0 and >1 are supported and specify points outside the text box. By default (0.5, 0.5) the starting point is centered in the text box.
Whether to draw the annotation when the annotation point xy is outside the axes area.
Additional kwargs are passed to Text.
See also
Pyplot tutorial
Annotations


Add an arrow to the Axes.
This draws an arrow from (x, y) to (x+dx, y+dy).
The x and y coordinates of the arrow base.
The length of the arrow along x and y direction.
Width of full arrow tail.
True if head is to be counted in calculating the length.
Total width of the full arrow head.
Length of arrow head.
Draw the left-half, right-half, or full arrow.
Fraction that the arrow is swept back (0 overhang means triangular shape). Can be negative or greater than one.
If True, the head starts being drawn at coordinate 0 instead of ending at coordinate 0.
Patch properties:
Property
Description
agg_filter
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha
unknown
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
color
color
edgecolor or ec
color or None
facecolor or fc
color or None
figure
Figure
fill
bool
gid
str
hatch
{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout
bool
joinstyle
JoinStyle or {'miter', 'round', 'bevel'}
label
object
linestyle or ls
{'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw
float or None
path_effects
AbstractPathEffect
picker
None or bool or float or callable
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
transform
Transform
url
str
visible
bool
zorder
float
The created FancyArrow object.
The resulting arrow is affected by the Axes aspect ratio and limits. This may produce an arrow whose head is not square with its stem. To create an arrow whose head is square with its stem, use annotate() for example:


Autoscale the axis view to the data (toggle).
Convenience method for simple axis view autoscaling. It turns autoscaling on or off, and then, if autoscaling for either axis is on, it performs the autoscaling on the specified axis or Axes.
True turns autoscaling on, False turns it off. None leaves the autoscaling state unchanged.
Which axis to operate on.
If True, first set the margins to zero. Then, this argument is forwarded to autoscale_view (regardless of its value); see the description of its behavior there.


Set the colormap to 'autumn'.
This changes the default colormap as well as the colormap of the current image if there is one. See help(colormaps) for more information.


Add an axes to the current figure and make it the current axes.
Call signatures:
The exact behavior of this function depends on the type:
The projection type of the Axes. str is the name of a custom projection, see projections. The default None results in a 'rectilinear' projection.
If True, equivalent to projection='polar'.
Share the x or y axis with sharex and/or sharey. The axis will have the same limits, ticks, and scale as the axis of the shared axes.
A label for the returned axes.
The returned axes class depends on the projection used. It is Axes if rectilinear projection is used and projections.polar.PolarAxes if polar projection is used.
This method also takes the keyword arguments for the returned axes class. The keyword arguments for the rectilinear axes class Axes can be found in the following table but there might also be other keyword arguments if another projection is used, see the actual axes class.
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
See also
If the figure already has a axes with key (args, kwargs) then it will simply make that axes current and return it. This behavior is deprecated. Meanwhile, if you do not want this behavior (i.e., you want to force the creation of a new axes), you must use a unique set of args and kwargs. The axes label attribute has been exposed for this purpose: if you want two axes that are otherwise identical to be added to the figure, make sure you give them unique labels.
Subplots spacings and margins
Make Room For Ylabel Using Axesgrid
Lasso Demo
Buttons
Check Buttons
Radio Buttons
Thresholding an Image with RangeSlider
Slider
Snapping Sliders to Discrete Values


Add a horizontal line across the axis.
y position in data coordinates of the horizontal line.
Should be between 0 and 1, 0 being the far left of the plot, 1 the far right of the plot.
Should be between 0 and 1, 0 being the far left of the plot, 1 the far right of the plot.
Valid keyword arguments are Line2D properties, with the exception of 'transform':
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
color
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
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'}
transform
unknown
url
str
visible
bool
xdata
1D array
ydata
1D array
zorder
float
See also
Add horizontal lines in data coordinates.
Add a horizontal span (rectangle) across the axis.
Add a line with an arbitrary slope.
draw a thick red hline at 'y' = 0 that spans the xrange:
draw a default hline at 'y' = 1 that spans the xrange:
draw a default hline at 'y' = .5 that spans the middle half of the xrange:
Infinite lines
Zorder Demo


Add a horizontal span (rectangle) across the Axes.
The rectangle spans from ymin to ymax vertically, and, by default, the whole x-axis horizontally. The x-span can be set using xmin (default: 0) and xmax (default: 1) which are in axis units; e.g. xmin = 0.5 always refers to the middle of the x-axis regardless of the limits set by set_xlim.
Lower y-coordinate of the span, in data units.
Upper y-coordinate of the span, in data units.
Lower x-coordinate of the span, in x-axis (0-1) units.
Upper x-coordinate of the span, in x-axis (0-1) units.
Horizontal span (rectangle) from (xmin, ymin) to (xmax, ymax).
Property
Description
agg_filter
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha
scalar or None
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
closed
bool
color
color
edgecolor or ec
color or None
facecolor or fc
color or None
figure
Figure
fill
bool
gid
str
hatch
{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout
bool
joinstyle
JoinStyle or {'miter', 'round', 'bevel'}
label
object
linestyle or ls
{'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw
float or None
path_effects
AbstractPathEffect
picker
None or bool or float or callable
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
transform
Transform
url
str
visible
bool
xy
(N, 2) array-like
zorder
float
See also
Add a vertical span across the Axes.


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
Filled polygon
Auto-wrapping text
Reference for Matplotlib artists
Pyplot tutorial


Add an infinitely long straight line.
The line can be defined either by two points xy1 and xy2, or by one point xy1 and a slope.
This draws a straight line "on the screen", regardless of the x and y scales, and is thus also suitable for drawing exponential decays in semilog plots, power laws in loglog plots, etc. However, slope should only be used with linear scales; It has no clear meaning for all other scales, and thus the behavior is undefined. Please specify the line using the points xy1, xy2 for non-linear scales.
The transform keyword argument only applies to the points xy1, xy2. The slope (if given) is always in data coordinates. This can be used e.g. with ax.transAxes for drawing grid lines with a fixed slope.
Points for the line to pass through. Either xy2 or slope has to be given.
The slope of the line. Either xy2 or slope has to be given.
Valid kwargs are Line2D properties
Property
Description
agg_filter
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha
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
color
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
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'}
transform
unknown
url
str
visible
bool
xdata
1D array
ydata
1D array
zorder
float
See also
for horizontal lines
for vertical lines
Draw a thick red line passing through (0, 0) and (1, 1):
Infinite lines


Add a vertical line across the Axes.
x position in data coordinates of the vertical line.
Should be between 0 and 1, 0 being the bottom of the plot, 1 the top of the plot.
Should be between 0 and 1, 0 being the bottom of the plot, 1 the top of the plot.
Valid keyword arguments are Line2D properties, with the exception of 'transform':
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
color
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
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'}
transform
unknown
url
str
visible
bool
xdata
1D array
ydata
1D array
zorder
float
See also
Add vertical lines in data coordinates.
Add a vertical span (rectangle) across the axis.
Add a line with an arbitrary slope.
draw a thick red vline at x = 0 that spans the yrange:
draw a default vline at x = 1 that spans the yrange:
draw a default vline at x = .5 that spans the middle half of the yrange:
Infinite lines


Add a vertical span (rectangle) across the Axes.
The rectangle spans from xmin to xmax horizontally, and, by default, the whole y-axis vertically. The y-span can be set using ymin (default: 0) and ymax (default: 1) which are in axis units; e.g. ymin = 0.5 always refers to the middle of the y-axis regardless of the limits set by set_ylim.
Lower x-coordinate of the span, in data units.
Upper x-coordinate of the span, in data units.
Lower y-coordinate of the span, in y-axis units (0-1).
Upper y-coordinate of the span, in y-axis units (0-1).
Vertical span (rectangle) from (xmin, ymin) to (xmax, ymax).
Property
Description
agg_filter
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha
scalar or None
animated
bool
antialiased or aa
bool or None
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
closed
bool
color
color
edgecolor or ec
color or None
facecolor or fc
color or None
figure
Figure
fill
bool
gid
str
hatch
{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
in_layout
bool
joinstyle
JoinStyle or {'miter', 'round', 'bevel'}
label
object
linestyle or ls
{'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw
float or None
path_effects
AbstractPathEffect
picker
None or bool or float or callable
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
transform
Transform
url
str
visible
bool
xy
(N, 2) array-like
zorder
float
See also
Add a horizontal span across the Axes.
Draw a vertical, green, translucent rectangle from x = 1.25 to x = 1.55 that spans the yrange of the Axes.


Make a bar plot.
The bars are positioned at x with the given alignment. Their dimensions are given by height and width. The vertical baseline is bottom (default 0).
Many parameters can take either a single value applying to all bars or a sequence of values, one for each bar.
The x coordinates of the bars. See also align for the alignment of the bars to the coordinates.
The height(s) of the bars.
The width(s) of the bars.
The y coordinate(s) of the bars bases.
Alignment of the bars to the x coordinates:
To align the bars on the right edge pass a negative width and align='edge'.
Container with all the bars and optionally errorbars.
The colors of the bar faces.
The colors of the bar edges.
Width of the bar edge(s). If 0, don't draw edges.
The tick labels of the bars. Default: None (Use default numeric labels.)
If not None, add horizontal / vertical errorbars to the bar tips. The values are +/- sizes relative to the data:
See Different ways of specifying error bars for an example on the usage of xerr and yerr.
The line color of the errorbars.
The length of the error bar caps in points.
Dictionary of kwargs to be passed to the errorbar method. Values of ecolor or capsize defined here take precedence over the independent kwargs.
If True, set the y-axis to be log scale.
If given, all parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception).
Property
Description
agg_filter
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha
scalar or None
angle
unknown
animated
bool
antialiased or aa
bool or None
bounds
(left, bottom, width, height)
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
color
color
edgecolor or ec
color or None
facecolor or fc
color or None
figure
Figure
fill
bool
gid
str
hatch
{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
height
unknown
in_layout
bool
joinstyle
JoinStyle or {'miter', 'round', 'bevel'}
label
object
linestyle or ls
{'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw
float or None
path_effects
AbstractPathEffect
picker
None or bool or float or callable
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
transform
Transform
url
str
visible
bool
width
unknown
x
unknown
xy
(float, float)
y
unknown
zorder
float
See also
Plot a horizontal bar plot.
Stacked bars can be achieved by passing individual bottom values per bar. See Stacked bar chart.
Table Demo
Pyplot tutorial


Label a bar plot.
Adds labels to bars in the given BarContainer. You may need to adjust the axis limits to fit the labels.
Container with all the bars and optionally errorbars, likely returned from bar or barh.
A list of label texts, that should be displayed. If not given, the label texts will be the data values formatted with fmt.
A format string for the label.
The label type. Possible values:
Distance of label from the end of the bar, in points.
Any remaining keyword arguments are passed through to Axes.annotate.
A list of Text instances for the labels.


Plot a 2D field of barbs.
Call signature:
Where X, Y define the barb locations, U, V define the barb directions, and C optionally sets the color.
All arguments may be 1D or 2D. U, V, C may be masked arrays, but masked X, Y are not supported at present.
Barbs are traditionally used in meteorology as a way to plot the speed and direction of wind observations, but can technically be used to plot any two dimensional vector quantity. As opposed to arrows, which give vector magnitude by the length of the arrow, the barbs give more quantitative information about the vector magnitude by putting slanted lines or a triangle for various increments in magnitude, as show schematically below:
The largest increment is given by a triangle (or "flag"). After those come full lines (barbs). The smallest increment is a half line. There is only, of course, ever at most 1 half line. If the magnitude is small and only needs a single half-line and no full lines or triangles, the half-line is offset from the end of the barb so that it can be easily distinguished from barbs with a single full line. The magnitude for the barb shown above would nominally be 65, using the standard increments of 50, 10, and 5.
See also https://en.wikipedia.org/wiki/Wind_barb.
The x and y coordinates of the barb locations. See pivot for how the barbs are drawn to the x, y positions.
If not given, they will be generated as a uniform integer meshgrid based on the dimensions of U and V.
If X and Y are 1D but U, V are 2D, X, Y are expanded to 2D using X, Y = np.meshgrid(X, Y). In this case len(X) and len(Y) must match the column and row dimensions of U and V.
The x and y components of the barb shaft.
Numeric data that defines the barb colors by colormapping via norm and cmap.
This does not support explicit colors. If you want to set colors directly, use barbcolor instead.
Length of the barb in points; the other parts of the barb are scaled against this.
The part of the arrow that is anchored to the X, Y grid. The barb rotates about this point. This can also be a number, which shifts the start of the barb that many points away from grid point.
The color of all parts of the barb except for the flags. This parameter is analogous to the edgecolor parameter for polygons, which can be used instead. However this parameter will override facecolor.
The color of any flags on the barb. This parameter is analogous to the facecolor parameter for polygons, which can be used instead. However, this parameter will override facecolor. If this is not set (and C has not either) then flagcolor will be set to match barbcolor so that the barb has a uniform color. If C has been set, flagcolor has no effect.
A dictionary of coefficients specifying the ratio of a given feature to the length of the barb. Only those values one wishes to override need to be included. These features include:
Whether the empty barbs (circles) that are drawn should be filled with the flag color. If they are not filled, the center is transparent.
Whether the vector magnitude should be rounded when allocating barb components. If True, the magnitude is rounded to the nearest multiple of the half-barb increment. If False, the magnitude is simply truncated to the next lowest multiple.
A dictionary of increments specifying values to associate with different parts of the barb. Only those values one wishes to override need to be included.
Whether the lines and flags should point opposite to normal. Normal behavior is for the barbs and lines to point right (comes from wind barbs having these features point towards low pressure in the Northern Hemisphere).
A single value is applied to all barbs. Individual barbs can be flipped by passing a bool array of the same size as U and V.
If given, all parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception).
The barbs can further be customized using PolyCollection keyword arguments:
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
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 rgba tuples
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
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
list of array-like
picker
None or bool or float or callable
pickradius
float
rasterized
bool
sizes
ndarray or None
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
transform
Transform
url
str
urls
list of str or None
verts
list of array-like
verts_and_codes
unknown
visible
bool
zorder
float


Make a horizontal bar plot.
The bars are positioned at y with the given alignment. Their dimensions are given by width and height. The horizontal baseline is left (default 0).
Many parameters can take either a single value applying to all bars or a sequence of values, one for each bar.
The y coordinates of the bars. See also align for the alignment of the bars to the coordinates.
The width(s) of the bars.
The heights of the bars.
The x coordinates of the left sides of the bars.
Alignment of the base to the y coordinates*:
To align the bars on the top edge pass a negative height and align='edge'.
Container with all the bars and optionally errorbars.
The colors of the bar faces.
The colors of the bar edges.
Width of the bar edge(s). If 0, don't draw edges.
The tick labels of the bars. Default: None (Use default numeric labels.)
If not None, add horizontal / vertical errorbars to the bar tips. The values are +/- sizes relative to the data:
See Different ways of specifying error bars for an example on the usage of xerr and yerr.
The line color of the errorbars.
The length of the error bar caps in points.
Dictionary of kwargs to be passed to the errorbar method. Values of ecolor or capsize defined here take precedence over the independent kwargs.
If True, set the x-axis to be log scale.
Property
Description
agg_filter
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha
scalar or None
angle
unknown
animated
bool
antialiased or aa
bool or None
bounds
(left, bottom, width, height)
capstyle
CapStyle or {'butt', 'projecting', 'round'}
clip_box
Bbox
clip_on
bool
clip_path
Patch or (Path, Transform) or None
color
color
edgecolor or ec
color or None
facecolor or fc
color or None
figure
Figure
fill
bool
gid
str
hatch
{'/', '\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
height
unknown
in_layout
bool
joinstyle
JoinStyle or {'miter', 'round', 'bevel'}
label
object
linestyle or ls
{'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw
float or None
path_effects
AbstractPathEffect
picker
None or bool or float or callable
rasterized
bool
sketch_params
(scale: float, length: float, randomness: float)
snap
bool or None
transform
Transform
url
str
visible
bool
width
unknown
x
unknown
xy
(float, float)
y
unknown
zorder
float
See also
Plot a vertical bar plot.
Stacked bars can be achieved by passing individual left values per bar. See Discrete distribution as horizontal bar chart .


Set the colormap to 'bone'.
This changes the default colormap as well as the colormap of the current image if there is one. See help(colormaps) for more information.


Turn the axes box on or off on the current axes.
The new Axes box state. If None, toggle the state.
See also