| [ Web Proxy ] |
| Viewing: https://matplotlib.org/stable/api/_as_gen/../../devel/MEP/../../users/../api/projections/polar.html | [Back] [Original] |
matplotlib.projections.polar#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.
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.
FigureThe 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, optionalThe 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 |
|
float 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) |
|
unknown |
|
str |
|
(left: float, right: float) |
|
float greater than -0.5 |
|
unknown |
|
unknown |
|
unknown |
|
(lower: float, upper: float) |
|
unknown |
|
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.
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.
If v0 == v1 (possibly up to some floating point slop), this
method returns an expanded interval around this value.
If (v0, v1) == (-inf, +inf), this method returns appropriate
default view limits.
Otherwise, (v0, v1) is returned without modification.
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.
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.
Called when the mouse moves during a pan operation.
MouseButtonThe pressed mouse button.
The pressed key, if any.
The mouse coordinates in display coords.
Notes
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.Notes
This method is overridden in the Artist subclasses.
Called when a pan operation completes (when the mouse button is up.)
Notes
This is intended to be overridden by new projection types.
Return the aspect ratio of the data itself. For a polar plot, this should always be 1.0
Get the direction in which theta increases.
Theta increases in the clockwise direction
Theta increases in the counterclockwise direction
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.
Notes
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.
Notes
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.
Notes
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 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.
Notes
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.
a.set(a=A, b=B, c=C)
is equivalent to
a.set_a(A)
a.set_b(B)
a.set_c(C)
In addition to the full property names, aliases are also supported, e.g.
set(lw=2) is equivalent to set(linewidth=2), but it is an error
to pass both simultaneously.
The order of the individual setter calls matches the order of parameters
in set(). However, most properties do not depend on each other so
that order is rarely relevant.
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
float 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
BboxBaseor Nonebool
Patch or (Path, Transform) or None
bool or "auto"
bool
str
bool
object
bool
bool
unknown
list of
AbstractPathEffectNone or bool or float or callable
[left, bottom, width, height] or
Bboxfloat 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)
unknown
str
(left: float, right: float)
float greater than -0.5
unknown
unknown
unknown
(lower: float, upper: float)
unknown
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.Line2DThe radial gridlines.
text.TextThe 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 direction in which theta increases.
Theta increases in the clockwise direction
Theta increases in the counterclockwise direction
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.Line2DThe theta gridlines.
text.TextThe 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.
Called when a pan operation has started.
The mouse coordinates in display coords.
MouseButtonThe pressed mouse button.
Notes
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.
AxesThe 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:
the label
the scale
locators, formatters and ticks
major and minor grid
units
registered callbacks
Set multiple properties at once.
a.set(a=A, b=B, c=C)
is equivalent to
a.set_a(A)
a.set_b(B)
a.set_c(C)
In addition to the full property names, aliases are also supported, e.g.
set(lw=2) is equivalent to set(linewidth=2), but it is an error
to pass both simultaneously.
The order of the individual setter calls matches the order of parameters
in set(). However, most properties do not depend on each other so
that order is rarely relevant.
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
float or None
bool
BboxBaseor Nonebool
Patch or (Path, Transform) or None
unknown
str
bool
unknown
unknown
unknown
{'left', 'right'}
str
Formatter,str, or functionunknown
Formatter,str, or functionbool
{'left', 'right'}
list of
AbstractPathEffectNone or bool or float or callable
float
bool
unknown
(scale: float, length: float, randomness: float)
bool or None
unknown
sequence of str or of
Texts1D 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.
If v0 == v1 (possibly up to some floating point slop), this
method returns an expanded interval around this value.
If (v0, v1) == (-inf, +inf), this method returns appropriate
default view limits.
Otherwise, (v0, v1) is returned without modification.
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.
The tick location in data coords.
The tick size in points.
Set multiple properties at once.
a.set(a=A, b=B, c=C)
is equivalent to
a.set_a(A)
a.set_b(B)
a.set_c(C)
In addition to the full property names, aliases are also supported, e.g.
set(lw=2) is equivalent to set(linewidth=2), but it is an error
to pass both simultaneously.
The order of the individual setter calls matches the order of parameters
in set(). However, most properties do not depend on each other so
that order is rarely relevant.
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
float or None
bool
BboxBaseor Nonebool
Patch or (Path, Transform) or None
str
bool
object
bool
float
list of
AbstractPathEffectNone or bool or float or callable
bool
(scale: float, length: float, randomness: float)
bool or None
str
bool
float
Bases: XAxis
A theta Axis.
This overrides certain properties of an XAxis to provide special-casing
for an angular axis.
AxesThe 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:
the label
the scale
locators, formatters and ticks
major and minor grid
units
registered callbacks
Set multiple properties at once.
a.set(a=A, b=B, c=C)
is equivalent to
a.set_a(A)
a.set_b(B)
a.set_c(C)
In addition to the full property names, aliases are also supported, e.g.
set(lw=2) is equivalent to set(linewidth=2), but it is an error
to pass both simultaneously.
The order of the individual setter calls matches the order of parameters
in set(). However, most properties do not depend on each other so
that order is rarely relevant.
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
float or None
bool
BboxBaseor Nonebool
Patch or (Path, Transform) or None
unknown
str
bool
unknown
unknown
unknown
{'top', 'bottom'}
str
Formatter,str, or function
Formatter,str, or functionbool
list of
AbstractPathEffectNone or bool or float or callable
float
bool
unknown
(scale: float, length: float, randomness: float)
bool or None
unknown
sequence of str or of
Texts1D 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.
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.
The tick location in data coords.
The tick size in points.
Set multiple properties at once.
a.set(a=A, b=B, c=C)
is equivalent to
a.set_a(A)
a.set_b(B)
a.set_c(C)
In addition to the full property names, aliases are also supported, e.g.
set(lw=2) is equivalent to set(linewidth=2), but it is an error
to pass both simultaneously.
The order of the individual setter calls matches the order of parameters
in set(). However, most properties do not depend on each other so
that order is rarely relevant.
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
float or None
bool
BboxBaseor Nonebool
Patch or (Path, Transform) or None
str
bool
object
bool
float
list of
AbstractPathEffectNone or bool or float or callable
bool
(scale: float, length: float, randomness: float)
bool or None
str
bool
float
| Web Proxy Viewer | New URL | Original Page |