Non-separable transforms that map from data space to screen space.
Projections are defined as Axes subclasses. They include the following elements:
cla), since the defaults for a rectilinear Axes may not be appropriate.matplotlib.projections.polar.Once the projection Axes is defined, it can be used in one of two ways:
By defining the class attribute name, the projection Axes can be registered with matplotlib.projections.register_projection and subsequently simply invoked by name:
fig.add_subplot(projection="my_proj_name")
For more complex, parameterisable projections, a generic "projection" object may be defined which includes the method _as_mpl_axes. _as_mpl_axes should take no arguments and return the projection's Axes subclass and a dictionary of additional arguments to pass to the subclass' __init__ method. Subsequently a parameterised projection can be initialised with:
fig.add_subplot(projection=MyProjection(param1=param1_value))
where MyProjection is an object which implements a _as_mpl_axes method.
A full-fledged and heavily annotated example is in Custom projection. The polar plot functionality in matplotlib.projections.polar may also be of interest.
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.
Get a projection class from its name.
If projection is None, a standard rectilinear projection is returned.
Return the names of all projections currently registered.
Matplotlib has built-in support for polar and some geographic projections. See the following pages for more information:
© 2012–2023 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
https://matplotlib.org/stable/api/projections_api.html