matplotlib.projections
¶matplotlib.projections.
ProjectionRegistry
¶Bases: object
Manages the set of projections available to the system.
get_projection_class
(name)¶Get a projection class from its name.
get_projection_names
()¶Get a list of the names of all projections currently registered.
register
(*projections)¶Register a new set of projection(s).
matplotlib.projections.
get_projection_class
(projection=None)¶Get a projection class from its name.
If projection is None, a standard rectilinear projection is returned.
matplotlib.projections.
get_projection_names
()¶Get a list of acceptable projection names.
matplotlib.projections.
process_projection_requirements
(figure, *args, **kwargs)¶Handle the args/kwargs to for add_axes/add_subplot/gca, returning:
(axes_proj_class, proj_class_kwargs, proj_stack_key)
Which can be used for new axes initialization/identification.
Note
kwargs is modified in place.
matplotlib.projections.polar
¶matplotlib.projections.polar.
InvertedPolarTransform
(axis=None, use_rmin=True)¶Bases: matplotlib.transforms.Transform
The inverse of the polar transform, mapping Cartesian coordinate space x and y back to theta and r.
inverted
()¶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))
transform_non_affine
(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
.
matplotlib.projections.polar.
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 ymax (for the radius maximum). The theta range is always fixed to (0, 2pi).
get_matrix
()¶Get the Affine transformation array for the affine part of this transform.
matplotlib.projections.polar.
PolarAxes
(*args, **kwargs)¶Bases: matplotlib.axes._axes.Axes
A polar graph projection, where the input dimensions are theta, r.
Theta starts pointing east and goes anticlockwise.
InvertedPolarTransform
(axis=None, use_rmin=True)¶Bases: matplotlib.transforms.Transform
The inverse of the polar transform, mapping Cartesian coordinate space x and y back to theta and r.
inverted
()¶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))
transform_non_affine
(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
.
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 ymax (for the radius maximum). The theta range is always fixed to (0, 2pi).
get_matrix
()¶Get the Affine transformation array for the affine part of this transform.
PolarTransform
(axis=None, use_rmin=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.
inverted
()¶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))
transform_non_affine
(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
.
RadialLocator
(base)¶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.
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.
can_pan
()¶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
()¶Return True if this axes supports the zoom box button functionality.
Polar axes do not support zoom boxes.
format_coord
(theta, r)¶Return a format string formatting the coordinate using Unicode characters.
get_data_ratio
()¶Return the aspect ratio of the data itself. For a polar plot, this should always be 1.0
get_rlabel_position
()¶Returns:  float


get_theta_direction
()¶Get the direction in which theta increases.
get_theta_offset
()¶Get the offset for the location of 0 in radians.
set_rgrids
(radii, labels=None, angle=None, fmt=None, **kwargs)¶Set the radial locations and labels of the r grids.
The labels will appear at radial distances radii at the given angle in degrees.
labels, if not None, is a len(radii)
list of strings of the
labels to use at each radius.
If labels is None, the builtin formatter will be used.
Return value is a list of tuples (line, label), where
line is Line2D
instances and the
label is Text
instances.
kwargs are optional text properties for the labels:
Property Description agg_filter
unknown alpha
float (0.0 transparent through 1.0 opaque) animated
[True  False] axes
an Axes
instancebackgroundcolor
any matplotlib color bbox
FancyBboxPatch prop dict clip_box
a matplotlib.transforms.Bbox
instanceclip_on
[True  False] clip_path
[ ( Path
,Transform
) Patch
 None ]color
any matplotlib color contains
a callable function family
or fontfamily or fontname or name[FONTNAME  ‘serif’  ‘sansserif’  ‘cursive’  ‘fantasy’  ‘monospace’ ] figure
a matplotlib.figure.Figure
instancefontproperties
or font_propertiesa matplotlib.font_manager.FontProperties
instancegid
an id string horizontalalignment
or ha[ ‘center’  ‘right’  ‘left’ ] label
string or anything printable with ‘%s’ conversion. linespacing
float (multiple of font size) multialignment
[‘left’  ‘right’  ‘center’ ] path_effects
unknown picker
[Nonefloatbooleancallable] position
(x,y) rasterized
[True  False  None] rotation
[ angle in degrees  ‘vertical’  ‘horizontal’ ] rotation_mode
unknown size
or fontsize[size in points  ‘xxsmall’  ‘xsmall’  ‘small’  ‘medium’  ‘large’  ‘xlarge’  ‘xxlarge’ ] sketch_params
unknown snap
unknown stretch
or fontstretch[a numeric value in range 01000  ‘ultracondensed’  ‘extracondensed’  ‘condensed’  ‘semicondensed’  ‘normal’  ‘semiexpanded’  ‘expanded’  ‘extraexpanded’  ‘ultraexpanded’ ] style
or fontstyle[ ‘normal’  ‘italic’  ‘oblique’] text
string or anything printable with ‘%s’ conversion. transform
Transform
instanceurl
a url string usetex
unknown variant
or fontvariant[ ‘normal’  ‘smallcaps’ ] verticalalignment
or ma or va[ ‘center’  ‘top’  ‘bottom’  ‘baseline’ ] visible
[True  False] weight
or fontweight[a numeric value in range 01000  ‘ultralight’  ‘light’  ‘normal’  ‘regular’  ‘book’  ‘medium’  ‘roman’  ‘semibold’  ‘demibold’  ‘demi’  ‘bold’  ‘heavy’  ‘extra bold’  ‘black’ ] wrap
unknown x
float y
float zorder
any number
ACCEPTS: sequence of floats
set_rlabel_position
(value)¶Updates the theta position of the radius labels.
Parameters:  value : number


set_theta_direction
(direction)¶Set the direction in which theta increases.
set_theta_offset
(offset)¶Set the offset for the location of 0 in radians.
set_theta_zero_location
(loc)¶Sets the location of theta’s zero. (Calls set_theta_offset with the correct value in radians under the hood.)
May be one of “N”, “NW”, “W”, “SW”, “S”, “SE”, “E”, or “NE”.
set_thetagrids
(angles, labels=None, frac=None, fmt=None, **kwargs)¶Set the angles at which to place the theta grids (these gridlines are equal along the theta dimension). angles is in degrees.
labels, if not None, is a len(angles)
list of strings of
the labels to use at each angle.
If labels is None, the labels will be fmt % angle
frac is the fraction of the polar axes radius at which to place the label (1 is the edge). e.g., 1.05 is outside the axes and 0.95 is inside the axes.
Return value is a list of tuples (line, label), where
line is Line2D
instances and the
label is Text
instances.
kwargs are optional text properties for the labels:
Property Description agg_filter
unknown alpha
float (0.0 transparent through 1.0 opaque) animated
[True  False] axes
an Axes
instancebackgroundcolor
any matplotlib color bbox
FancyBboxPatch prop dict clip_box
a matplotlib.transforms.Bbox
instanceclip_on
[True  False] clip_path
[ ( Path
,Transform
) Patch
 None ]color
any matplotlib color contains
a callable function family
or fontfamily or fontname or name[FONTNAME  ‘serif’  ‘sansserif’  ‘cursive’  ‘fantasy’  ‘monospace’ ] figure
a matplotlib.figure.Figure
instancefontproperties
or font_propertiesa matplotlib.font_manager.FontProperties
instancegid
an id string horizontalalignment
or ha[ ‘center’  ‘right’  ‘left’ ] label
string or anything printable with ‘%s’ conversion. linespacing
float (multiple of font size) multialignment
[‘left’  ‘right’  ‘center’ ] path_effects
unknown picker
[Nonefloatbooleancallable] position
(x,y) rasterized
[True  False  None] rotation
[ angle in degrees  ‘vertical’  ‘horizontal’ ] rotation_mode
unknown size
or fontsize[size in points  ‘xxsmall’  ‘xsmall’  ‘small’  ‘medium’  ‘large’  ‘xlarge’  ‘xxlarge’ ] sketch_params
unknown snap
unknown stretch
or fontstretch[a numeric value in range 01000  ‘ultracondensed’  ‘extracondensed’  ‘condensed’  ‘semicondensed’  ‘normal’  ‘semiexpanded’  ‘expanded’  ‘extraexpanded’  ‘ultraexpanded’ ] style
or fontstyle[ ‘normal’  ‘italic’  ‘oblique’] text
string or anything printable with ‘%s’ conversion. transform
Transform
instanceurl
a url string usetex
unknown variant
or fontvariant[ ‘normal’  ‘smallcaps’ ] verticalalignment
or ma or va[ ‘center’  ‘top’  ‘bottom’  ‘baseline’ ] visible
[True  False] weight
or fontweight[a numeric value in range 01000  ‘ultralight’  ‘light’  ‘normal’  ‘regular’  ‘book’  ‘medium’  ‘roman’  ‘semibold’  ‘demibold’  ‘demi’  ‘bold’  ‘heavy’  ‘extra bold’  ‘black’ ] wrap
unknown x
float y
float zorder
any number
ACCEPTS: sequence of floats
matplotlib.projections.polar.
PolarTransform
(axis=None, use_rmin=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.
inverted
()¶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))
transform_non_affine
(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
.
matplotlib.projections.polar.
RadialLocator
(base)¶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.
matplotlib.projections.polar.
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.