Bases: Transform
The inverse of the polar transform, mapping Cartesian coordinate space x and y back to theta and r.
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 an array of length input_dims or shape (N, input_dims).
The output values as an array of length output_dims or shape (N, output_dims), depending on the input.
Bases: Affine2DBase
The affine part of the polar projection.
Scales the output so that maximum radius rests on the edge of the Axes circle and the origin is mapped to (0.5, 0.5). The transform applied is the same to x and y components and given by:
\(r_{\min}, r_{\max}\) are the minimum and maximum radial limits after any scaling (e.g. log scaling) has been removed.
Get the matrix for the affine part of this transform.
Bases: 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.
Figure
The Axes is built in the Figure fig.
*args can be a single (left, bottom, width, height) rectangle or a single Bbox. This specifies the rectangle (in figure coordinates) where the Axes is positioned.
*args can also consist of three numbers or a single three-digit number; in the latter case, the digits are considered as independent numbers. The numbers are interpreted as (nrows,
ncols, index): (nrows, ncols) specifies the size of an array of subplots, and index is the 1-based index of the subplot being created. Finally, *args can also directly be a SubplotSpec instance.
Axes, optional
The x- or y-axis is shared with the x- or y-axis in the input Axes. Note that it is not possible to unshare 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.
Control whether pan/zoom events are passed through to Axes below this one. "auto" is True for axes with an invisible patch and False otherwise.
Other optional keyword arguments:
Property | Description |
|---|---|
{'box', 'datalim'} | |
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image | |
scalar or None | |
(float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} | |
bool | |
{'auto', 'equal'} or float | |
bool | |
unknown | |
unknown | |
Callable[[Axes, Renderer], Bbox] | |
bool or 'line' | |
float or None | |
| |
bool | |
Patch or (Path, Transform) or None | |
| |
bool or "auto" | |
bool | |
str | |
bool | |
object | |
bool | |
bool | |
unknown | |
list of | |
None or bool or float or callable | |
[left, bottom, width, height] or | |
float or None | |
bool | |
(scale: float, length: float, randomness: float) | |
bool or None | |
unknown | |
str | |
str | |
bool | |
(lower: float, upper: float) | |
str | |
(left: float, right: float) | |
float greater than -0.5 | |
unknown | |
unknown | |
unknown | |
(lower: float, upper: float) | |
str | |
(bottom: float, top: float) | |
float greater than -0.5 | |
unknown | |
unknown | |
unknown | |
float |
Bases: Transform
The inverse of the polar transform, mapping Cartesian coordinate space x and y back to theta and r.
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 an array of length input_dims or shape (N, input_dims).
The output values as an array of length output_dims or shape (N, output_dims), depending on the input.
Bases: Affine2DBase
The affine part of the polar projection.
Scales the output so that maximum radius rests on the edge of the Axes circle and the origin is mapped to (0.5, 0.5). The transform applied is the same to x and y components and given by:
\(r_{\min}, r_{\max}\) are the minimum and maximum radial limits after any scaling (e.g. log scaling) has been removed.
Get the matrix for the affine part of this transform.
Bases: Transform
The base polar transform.
This transform maps polar coordinates \(\theta, r\) into Cartesian coordinates \(x, y = r \cos(\theta), r \sin(\theta)\) (but does not fully transform into Axes coordinates or handle positioning in screen space).
This transformation is designed to be applied to data after any scaling along the radial axis (e.g. log-scaling) has been applied to the input data.
Path segments at a fixed radius are automatically transformed to circular arcs as long as path._interpolation_steps > 1.
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 an array of length input_dims or shape (N, input_dims).
The output values as an array of length output_dims or shape (N, output_dims), depending on the input.
Bases: 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.
v0 == v1 (possibly up to some floating point slop), this method returns an expanded interval around this value.(v0, v1) == (-inf, +inf), this method returns appropriate default view limits.(v0, v1) is returned without modification.Select a scale for the range from vmin to vmax.
Subclasses should override this method to change locator behaviour.
Bases: Formatter
Used to format the theta tick labels. Converts the native unit of radians into degrees and adds a degree symbol.
Bases: 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 a 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.
A polar Axes does not support zoom boxes.
Clear the Axes.
Called when the mouse moves during a pan operation.
MouseButton
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).
RendererBase subclass.
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 |
|---|---|
{'box', 'datalim'} | |
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image | |
scalar or None | |
(float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...} | |
bool | |
{'auto', 'equal'} or float | |
bool | |
unknown | |
unknown | |
Callable[[Axes, Renderer], Bbox] | |
bool or 'line' | |
float or None | |
| |
bool | |
Patch or (Path, Transform) or None | |
| |
bool or "auto" | |
bool | |
str | |
bool | |
object | |
bool | |
bool | |
unknown | |
list of | |
None or bool or float or callable | |
[left, bottom, width, height] or | |
float or None | |
bool | |
tuple with floats | |
number | |
unknown | |
float | |
float | |
float | |
unknown | |
unknown | |
(scale: float, length: float, randomness: float) | |
bool or None | |
unknown | |
unknown | |
unknown | |
str | |
tuple with floats, degrees | |
unknown | |
unknown | |
unknown | |
str | |
str | |
bool | |
(lower: float, upper: float) | |
str | |
(left: float, right: float) | |
float greater than -0.5 | |
unknown | |
unknown | |
unknown | |
(lower: float, upper: float) | |
str | |
(bottom: float, top: float) | |
float greater than -0.5 | |
unknown | |
unknown | |
unknown | |
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'.
lines.Line2D
The radial gridlines.
text.Text
The tick labels.
kwargs are optional Text properties for the labels.
Warning
This only sets the properties of the current ticks. Ticks are not guaranteed to be persistent. Various operations can create, delete and modify the Tick instances. There is an imminent risk that these settings can get lost if you work on the figure further (including also panning/zooming on a displayed figure).
Use set_tick_params instead if possible.
Update the theta position of the radius labels.
The angular position of the radius labels in degrees.
Set the radial axis view limits.
This function behaves like Axes.set_ylim, but additionally supports rmin and rmax as aliases for bottom and top.
See also
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.
lines.Line2D
The theta gridlines.
text.Text
The tick labels.
kwargs are optional Text properties for the labels.
Warning
This only sets the properties of the current ticks. Ticks are not guaranteed to be persistent. Various operations can create, delete and modify the Tick instances. There is an imminent risk that these settings can get lost if you work on the figure further (including also panning/zooming on a displayed figure).
Use set_tick_params instead if possible.
Set the minimum and maximum theta values.
Can take the following signatures:
set_thetalim(minval, maxval): Set the limits in radians.set_thetalim(thetamin=minval, thetamax=maxval): Set the limits in degrees.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 axis 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 yaxis' scale.
ScaleBase
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.
MouseButton
The pressed mouse button.
This is intended to be overridden by new projection types.
Bases: Transform
The base polar transform.
This transform maps polar coordinates \(\theta, r\) into Cartesian coordinates \(x, y = r \cos(\theta), r \sin(\theta)\) (but does not fully transform into Axes coordinates or handle positioning in screen space).
This transformation is designed to be applied to data after any scaling along the radial axis (e.g. log-scaling) has been applied to the input data.
Path segments at a fixed radius are automatically transformed to circular arcs as long as path._interpolation_steps > 1.
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 an array of length input_dims or shape (N, input_dims).
The output values as an array of length output_dims or shape (N, output_dims), depending on the input.
Bases: YAxis
A radial Axis.
This overrides certain properties of a YAxis to provide special-casing for a radial axis.
Axes
The Axes to which the created Axis belongs.
The acceptance radius for containment tests. See also Axis.contains.
Whether to clear the Axis on creation. This is not required, e.g., when creating an Axis as part of an Axes, as Axes.clear will call Axis.clear. .. versionadded:: 3.8
Read-only name identifying the axis.
Clear the axis.
This resets axis properties to their default values:
Set multiple properties at once.
Supported properties are
Property | Description |
|---|---|
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image | |
scalar or None | |
bool | |
| |
bool | |
Patch or (Path, Transform) or None | |
unknown | |
str | |
bool | |
unknown | |
object | |
unknown | |
{'left', 'right'} | |
str | |
| |
| |
bool | |
{'left', 'right'} | |
list of | |
None or bool or float or callable | |
float | |
bool | |
unknown | |
(scale: float, length: float, randomness: float) | |
bool or None | |
unknown | |
sequence of str or of | |
1D array-like | |
{'left', 'right', 'both', 'default', 'none'} | |
units tag | |
str | |
unknown | |
bool | |
float |
Bases: 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.
v0 == v1 (possibly up to some floating point slop), this method returns an expanded interval around this value.(v0, v1) == (-inf, +inf), this method returns appropriate default view limits.(v0, v1) is returned without modification.Select a scale for the range from vmin to vmax.
Subclasses should override this method to change locator behaviour.
Bases: 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 |
|---|---|
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image | |
scalar or None | |
bool | |
| |
bool | |
Patch or (Path, Transform) or None | |
str | |
bool | |
unknown | |
unknown | |
unknown | |
bool | |
float | |
list of | |
None or bool or float or callable | |
bool | |
(scale: float, length: float, randomness: float) | |
bool or None | |
str | |
bool | |
float |
Set the location of tick in data coords with scalar loc.
Bases: XAxis
A theta Axis.
This overrides certain properties of an XAxis to provide special-casing for an angular axis.
Axes
The Axes to which the created Axis belongs.
The acceptance radius for containment tests. See also Axis.contains.
Whether to clear the Axis on creation. This is not required, e.g., when creating an Axis as part of an Axes, as Axes.clear will call Axis.clear. .. versionadded:: 3.8
Read-only name identifying the axis.
Clear the axis.
This resets axis properties to their default values:
Set multiple properties at once.
Supported properties are
Property | Description |
|---|---|
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image | |
scalar or None | |
bool | |
| |
bool | |
Patch or (Path, Transform) or None | |
unknown | |
str | |
bool | |
unknown | |
object | |
unknown | |
{'top', 'bottom'} | |
str | |
| |
| |
bool | |
list of | |
None or bool or float or callable | |
float | |
bool | |
unknown | |
(scale: float, length: float, randomness: float) | |
bool or None | |
unknown | |
sequence of str or of | |
1D array-like | |
{'top', 'bottom', 'both', 'default', 'none'} | |
units tag | |
str | |
unknown | |
bool | |
float |
Bases: Formatter
Used to format the theta tick labels. Converts the native unit of radians into degrees and adds a degree symbol.
Bases: 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: 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 |
|---|---|
a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image | |
scalar or None | |
bool | |
| |
bool | |
Patch or (Path, Transform) or None | |
str | |
bool | |
unknown | |
unknown | |
unknown | |
bool | |
float | |
list of | |
None or bool or float or callable | |
bool | |
(scale: float, length: float, randomness: float) | |
bool or None | |
str | |
bool | |
float |
Set the location of tick in data coords with scalar loc.
© 2012–2023 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/stable/api/projections/polar.html