class matplotlib.projections.ProjectionRegistry
[source]
Bases: object
Manages the set of projections available to the system.
get_projection_class(self, name)
[source]
Get a projection class from its name.
get_projection_names(self)
[source]
Get a list of the names of all projections currently registered.
register(self, *projections)
[source]
Register a new set of projections.
matplotlib.projections.get_projection_class(projection=None)
[source]
Get a projection class from its name.
If projection is None, a standard rectilinear projection is returned.
matplotlib.projections.get_projection_names()
[source]
Get a list of acceptable projection names.
matplotlib.projections.process_projection_requirements(figure, *args, **kwargs)
[source]
[Deprecated]
Deprecated since version 3.1:
matplotlib.projections.register_projection(cls)
[source]
class matplotlib.projections.polar.InvertedPolarTransform(axis=None, use_rmin=True, _apply_theta_transforms=True)
[source]
Bases: matplotlib.transforms.Transform
The inverse of the polar transform, mapping Cartesian coordinate space x and y back to theta and r.
input_dims = 2
inverted(self)
[source]
Return the corresponding inverse transformation.
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.
x === self.inverted().transform(self.transform(x))
is_separable = False
output_dims = 2
transform_non_affine(self, xy)
[source]
Performs only the nonaffine part of the transformation.
transform(values)
is always equivalent to transform_affine(transform_non_affine(values))
.
In nonaffine transformations, this is generally equivalent to transform(values)
. In affine transformations, this is always a noop.
Accepts a numpy array of shape (N x input_dims
) and returns a numpy array of shape (N x output_dims
).
Alternatively, accepts a numpy array of length input_dims
and returns a numpy array of length output_dims
.
class matplotlib.projections.polar.PolarAffine(scale_transform, limits)
[source]
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 nonaffine transform.
get_matrix(self)
[source]
Get the Affine transformation array for the affine part of this transform.
class matplotlib.projections.polar.PolarAxes(*args, theta_offset=0, theta_direction=1, rlabel_position=22.5, **kwargs)
[source]
Bases: matplotlib.axes._axes.Axes
A polar graph projection, where the input dimensions are theta, r.
Theta starts pointing east and goes anticlockwise.
class InvertedPolarTransform(axis=None, use_rmin=True, _apply_theta_transforms=True)
Bases: matplotlib.transforms.Transform
The inverse of the polar transform, mapping Cartesian coordinate space x and y back to theta and r.
input_dims = 2
inverted(self)
Return the corresponding inverse transformation.
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.
x === self.inverted().transform(self.transform(x))
is_separable = False
output_dims = 2
transform_non_affine(self, xy)
Performs only the nonaffine part of the transformation.
transform(values)
is always equivalent to transform_affine(transform_non_affine(values))
.
In nonaffine transformations, this is generally equivalent to transform(values)
. In affine transformations, this is always a noop.
Accepts a numpy array of shape (N x input_dims
) and returns a numpy array of shape (N x output_dims
).
Alternatively, accepts a numpy array of length input_dims
and returns a numpy array of length output_dims
.
class PolarAffine(scale_transform, limits)
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 nonaffine transform.
get_matrix(self)
Get the Affine transformation array for the affine part of this transform.
class PolarTransform(axis=None, use_rmin=True, _apply_theta_transforms=True)
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.
input_dims = 2
inverted(self)
Return the corresponding inverse transformation.
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.
x === self.inverted().transform(self.transform(x))
is_separable = False
output_dims = 2
transform_non_affine(self, tr)
Performs only the nonaffine part of the transformation.
transform(values)
is always equivalent to transform_affine(transform_non_affine(values))
.
In nonaffine transformations, this is generally equivalent to transform(values)
. In affine transformations, this is always a noop.
Accepts a numpy array of shape (N x input_dims
) and returns a numpy array of shape (N x output_dims
).
Alternatively, accepts a numpy array of length input_dims
and returns a numpy array of length output_dims
.
transform_path_non_affine(self, path)
Returns a path, transformed only by the nonaffine part of this transform.
path: a Path
instance.
transform_path(path)
is equivalent to transform_path_affine(transform_path_non_affine(values))
.
class RadialLocator(base, axes=None)
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 raxis.
autoscale(self)
autoscale the view limits
pan(self, numsteps)
Pan numticks (can be positive or negative)
refresh(self)
refresh internal information based on current lim
view_limits(self, vmin, vmax)
Select a scale for the range from vmin to vmax.
Subclasses should override this method to change locator behaviour.
zoom(self, direction)
Zoom in/out on axis; if direction is >0 zoom in, else zoom out
class ThetaFormatter
Bases: matplotlib.ticker.Formatter
Used to format the theta tick labels. Converts the native unit of radians into degrees and adds a degree symbol.
class ThetaLocator(base)
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.
autoscale(self)
autoscale the view limits
pan(self, numsteps)
Pan numticks (can be positive or negative)
refresh(self)
refresh internal information based on current lim
set_axis(self, axis)
view_limits(self, vmin, vmax)
Select a scale for the range from vmin to vmax.
Subclasses should override this method to change locator behaviour.
zoom(self, direction)
Zoom in/out on axis; if direction is >0 zoom in, else zoom out
can_pan(self)
[source]
Return True if 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.
can_zoom(self)
[source]
Return True if this axes supports the zoom box button functionality.
Polar axes do not support zoom boxes.
cla(self)
[source]
Clear the current axes.
drag_pan(self, button, key, x, y)
[source]
Called when the mouse moves during a pan operation.
button is the mouse button number:
key is a "shift" key
x, y are the mouse coordinates in display coords.
Note
Intended to be overridden by new projection types.
draw(self, *args, **kwargs)
[source]
Draw everything (plot lines, axes, labels)
end_pan(self)
[source]
Called when a pan operation completes (when the mouse button is up.)
Note
Intended to be overridden by new projection types.
format_coord(self, theta, r)
[source]
Return a format string formatting the coordinate using Unicode characters.
get_data_ratio(self)
[source]
Return the aspect ratio of the data itself. For a polar plot, this should always be 1.0
get_rlabel_position(self)
[source]
Returns: 


get_rmax(self)
[source]
Returns: 


get_rmin(self)
[source]
Returns: 


get_rorigin(self)
[source]
Returns: 


get_rsign(self)
[source]
get_theta_direction(self)
[source]
Get the direction in which theta increases.
get_theta_offset(self)
[source]
Get the offset for the location of 0 in radians.
get_thetamax(self)
[source]
get_thetamin(self)
[source]
get_xaxis_text1_transform(self, pad)
[source]
Returns: 


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_xaxis_text2_transform(self, pad)
[source]
Returns: 


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_xaxis_transform(self, which='grid')
[source]
Get the transformation used for drawing xaxis labels, ticks and gridlines. The xdirection is in data coordinates and the ydirection 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.
get_yaxis_text1_transform(self, pad)
[source]
Returns: 


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_yaxis_text2_transform(self, pad)
[source]
Returns: 


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_yaxis_transform(self, which='grid')
[source]
Get the transformation used for drawing yaxis labels, ticks and gridlines. The xdirection is in axis coordinates and the ydirection 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.
name = 'polar'
set_rgrids(self, radii, labels=None, angle=None, fmt=None, **kwargs)
[source]
Set the radial gridlines on a polar plot.
Parameters: 


Returns: 

Other Parameters: 

set_rlabel_position(self, value)
[source]
Updates the theta position of the radius labels.
Parameters: 


set_rmax(self, rmax)
[source]
Set the outer radial limit.
Parameters: 


set_rmin(self, rmin)
[source]
Set the inner radial limit.
Parameters: 


set_rorigin(self, rorigin)
[source]
Update the radial origin.
Parameters: 


set_rscale(self, *args, **kwargs)
[source]
set_rticks(self, *args, **kwargs)
[source]
set_theta_direction(self, direction)
[source]
Set the direction in which theta increases.
set_theta_offset(self, offset)
[source]
Set the offset for the location of 0 in radians.
set_theta_zero_location(self, loc, offset=0.0)
[source]
Sets the location of theta's zero. (Calls set_theta_offset with the correct value in radians under the hood.)
loc : str
offset : float, optional
loc
. Note: this offset is always applied counterclockwise regardless of the direction setting.set_thetagrids(self, angles, labels=None, fmt=None, **kwargs)
[source]
Set the theta gridlines in a polar plot.
Parameters: 


Returns: 

Other Parameters: 

set_thetalim(self, *args, **kwargs)
[source]
Set the minimum and maximum theta values.
Parameters: 


set_thetamax(self, thetamax)
[source]
set_thetamin(self, thetamin)
[source]
set_xscale(self, scale, *args, **kwargs)
[source]
Set the xaxis scale.
Parameters: 


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.
set_ylim(self, bottom=None, top=None, emit=True, auto=False, *, ymin=None, ymax=None)
[source]
Set the data limits for the radial axis.
Parameters: 


Returns: 

set_yscale(self, *args, **kwargs)
[source]
Set the yaxis scale.
Parameters: 


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.
start_pan(self, x, y, button)
[source]
Called when a pan operation has started.
x, y are the mouse coordinates in display coords. button is the mouse button number:
Note
Intended to be overridden by new projection types.
class matplotlib.projections.polar.PolarTransform(axis=None, use_rmin=True, _apply_theta_transforms=True)
[source]
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.
input_dims = 2
inverted(self)
[source]
Return the corresponding inverse transformation.
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.
x === self.inverted().transform(self.transform(x))
is_separable = False
output_dims = 2
transform_non_affine(self, tr)
[source]
Performs only the nonaffine part of the transformation.
transform(values)
is always equivalent to transform_affine(transform_non_affine(values))
.
In nonaffine transformations, this is generally equivalent to transform(values)
. In affine transformations, this is always a noop.
Accepts a numpy array of shape (N x input_dims
) and returns a numpy array of shape (N x output_dims
).
Alternatively, accepts a numpy array of length input_dims
and returns a numpy array of length output_dims
.
class matplotlib.projections.polar.RadialAxis(*args, **kwargs)
[source]
Bases: matplotlib.axis.YAxis
A radial Axis.
This overrides certain properties of a YAxis
to provide specialcasing for a radial axis.
axis_name = 'radius'
cla(self)
[source]
clear the current axis
class matplotlib.projections.polar.RadialLocator(base, axes=None)
[source]
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 raxis.
autoscale(self)
[source]
autoscale the view limits
pan(self, numsteps)
[source]
Pan numticks (can be positive or negative)
refresh(self)
[source]
refresh internal information based on current lim
view_limits(self, vmin, vmax)
[source]
Select a scale for the range from vmin to vmax.
Subclasses should override this method to change locator behaviour.
zoom(self, direction)
[source]
Zoom in/out on axis; if direction is >0 zoom in, else zoom out
class matplotlib.projections.polar.RadialTick(axes, loc, label, size=None, width=None, color=None, tickdir=None, pad=None, labelsize=None, labelcolor=None, zorder=None, gridOn=None, tick1On=True, tick2On=True, label1On=True, label2On=False, major=True, labelrotation=0, grid_color=None, grid_linestyle=None, grid_linewidth=None, grid_alpha=None, **kw)
[source]
Bases: matplotlib.axis.YTick
A radialaxis tick.
This subclass of YTick
provides radial ticks with some small modification to their repositioning 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
update_position(self, loc)
[source]
Set the location of tick in data coords with scalar loc.
class matplotlib.projections.polar.ThetaAxis(axes, pickradius=15)
[source]
Bases: matplotlib.axis.XAxis
A theta Axis.
This overrides certain properties of an XAxis
to provide specialcasing for an angular axis.
Parameters: 


axis_name = 'theta'
cla(self)
[source]
clear the current axis
class matplotlib.projections.polar.ThetaFormatter
[source]
Bases: matplotlib.ticker.Formatter
Used to format the theta tick labels. Converts the native unit of radians into degrees and adds a degree symbol.
class matplotlib.projections.polar.ThetaLocator(base)
[source]
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.
autoscale(self)
[source]
autoscale the view limits
pan(self, numsteps)
[source]
Pan numticks (can be positive or negative)
refresh(self)
[source]
refresh internal information based on current lim
set_axis(self, axis)
[source]
view_limits(self, vmin, vmax)
[source]
Select a scale for the range from vmin to vmax.
Subclasses should override this method to change locator behaviour.
zoom(self, direction)
[source]
Zoom in/out on axis; if direction is >0 zoom in, else zoom out
class matplotlib.projections.polar.ThetaTick(axes, *args, **kwargs)
[source]
Bases: matplotlib.axis.XTick
A thetaaxis tick.
This subclass of XTick
provides angular ticks with some small modification to their repositioning 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 tickspecific padding.
update_position(self, loc)
[source]
Set the location of tick in data coords with scalar loc.
© 2012–2018 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/3.1.1/api/projections_api.html