matplotlib.projections
#
Non-separable transforms that map from data space to screen space.
Projections are defined as Axes
subclasses. They include the
following elements:
A transformation from data coordinates into display coordinates.
An inverse of that transformation. This is used, for example, to convert mouse positions from screen space back into data space.
Transformations for the gridlines, ticks and ticklabels. Custom projections will often need to place these elements in special locations, and Matplotlib has a facility to help with doing so.
Setting up default values (overriding
cla
), since the defaults for a rectilinear axes may not be appropriate.Defining the shape of the axes, for example, an elliptical axes, that will be used to draw the background of the plot and for clipping any data elements.
Defining custom locators and formatters for the projection. For example, in a geographic projection, it may be more convenient to display the grid in degrees, even if the data is in radians.
Set up interactive panning and zooming. This is left as an "advanced" feature left to the reader, but there is an example of this for polar plots in
matplotlib.projections.polar
.Any additional methods for additional convenience or features.
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 withmatplotlib.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.
- class matplotlib.projections.ProjectionRegistry[source]#
Bases:
object
A mapping of registered projection names to projection classes.
- 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]#
Return the names of all projections currently registered.
matplotlib.projections.polar
#
- class matplotlib.projections.polar.InvertedPolarTransform(axis=None, use_rmin=True, _apply_theta_transforms=True)[source]#
Bases:
Transform
The inverse of the polar transform, mapping Cartesian coordinate space x and y back to theta and r.
- Parameters:
- shorthand_namestr
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of
str(transform)
when DEBUG=True.
- has_inverse = True#
True if this transform has a corresponding inverse transform.
- input_dims = 2#
The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.
- inverted()[source]#
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.
- output_dims = 2#
The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.
- transform_non_affine(xy)[source]#
Apply only the non-affine part of this transformation.
transform(values)
is always equivalent totransform_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.- Parameters:
- valuesarray
The input values as NumPy array of length
input_dims
or shape (N xinput_dims
).
- Returns:
- array
The output values as NumPy array of length
output_dims
or shape (N xoutput_dims
), depending on the input.
- class matplotlib.projections.polar.PolarAffine(scale_transform, limits)[source]#
Bases:
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 non-affine transform.
- class matplotlib.projections.polar.PolarAxes(*args, theta_offset=0, theta_direction=1, rlabel_position=22.5, **kwargs)[source]#
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.
- Parameters:
- fig
Figure
The Axes is built in the
Figure
fig.- recttuple (left, bottom, width, height).
The Axes is built in the rectangle rect. rect is in
Figure
coordinates.- sharex, sharey
Axes
, optional The x or y
axis
is shared with the x or y axis in the inputAxes
.- frameonbool, default: True
Whether the Axes frame is visible.
- box_aspectfloat, optional
Set a fixed aspect for the Axes box, i.e. the ratio of height to width. See
set_box_aspect
for details.- **kwargs
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
facecolor
or fccolor
bool
str
bool
object
bool
bool
unknown
None or bool or float or callable
[left, bottom, width, height] or
Bbox
unknown
float or None
bool
(scale: float, length: float, randomness: float)
bool or None
str
str
bool
unknown
str
(bottom: float, top: float)
float greater than -0.5
unknown
unknown
unknown
unknown
str
(bottom: float, top: float)
float greater than -0.5
unknown
unknown
unknown
float
- fig
- Returns:
- class InvertedPolarTransform(axis=None, use_rmin=True, _apply_theta_transforms=True)[source]#
Bases:
Transform
The inverse of the polar transform, mapping Cartesian coordinate space x and y back to theta and r.
- Parameters:
- shorthand_namestr
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of
str(transform)
when DEBUG=True.
- has_inverse = True#
True if this transform has a corresponding inverse transform.
- input_dims = 2#
The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.
- inverted()[source]#
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.
- output_dims = 2#
The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.
- transform_non_affine(xy)[source]#
Apply only the non-affine part of this transformation.
transform(values)
is always equivalent totransform_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.- Parameters:
- valuesarray
The input values as NumPy array of length
input_dims
or shape (N xinput_dims
).
- Returns:
- array
The output values as NumPy array of length
output_dims
or shape (N xoutput_dims
), depending on the input.
- class PolarAffine(scale_transform, limits)[source]#
Bases:
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 non-affine transform.
- class PolarTransform(axis=None, use_rmin=True, _apply_theta_transforms=True)[source]#
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 handle positioning in screen space).Path segments at a fixed radius are automatically transformed to circular arcs as long as
path._interpolation_steps > 1
.- Parameters:
- shorthand_namestr
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of
str(transform)
when DEBUG=True.
- has_inverse = True#
True if this transform has a corresponding inverse transform.
- input_dims = 2#
The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.
- inverted()[source]#
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.
- output_dims = 2#
The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.
- transform_non_affine(tr)[source]#
Apply only the non-affine part of this transformation.
transform(values)
is always equivalent totransform_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.- Parameters:
- valuesarray
The input values as NumPy array of length
input_dims
or shape (N xinput_dims
).
- Returns:
- array
The output values as NumPy array of length
output_dims
or shape (N xoutput_dims
), depending on the input.
- class RadialLocator(base, axes=None)[source]#
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).- nonsingular(vmin, vmax)[source]#
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.
- class ThetaFormatter[source]#
Bases:
Formatter
Used to format the theta tick labels. Converts the native unit of radians into degrees and adds a degree symbol.
- class ThetaLocator(base)[source]#
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.
- can_pan()[source]#
Return whether 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()[source]#
Return whether this axes supports the zoom box button functionality.
Polar axes do not support zoom boxes.
- drag_pan(button, key, x, y)[source]#
Called when the mouse moves during a pan operation.
- Parameters:
- button
MouseButton
The pressed mouse button.
- keystr or None
The pressed key, if any.
- x, yfloat
The mouse coordinates in display coords.
- button
Notes
This is intended to be overridden by new projection types.
- draw(renderer)[source]#
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).- Parameters:
- renderer
RendererBase
subclass.
- renderer
Notes
This method is overridden in the Artist subclasses.
- end_pan()[source]#
Called when a pan operation completes (when the mouse button is up.)
Notes
This is intended to be overridden by new projection types.
- get_data_ratio()[source]#
Return the aspect ratio of the data itself. For a polar plot, this should always be 1.0
- get_theta_direction()[source]#
Get the direction in which theta increases.
- -1:
Theta increases in the clockwise direction
- 1:
Theta increases in the counterclockwise direction
- get_xaxis_text1_transform(pad)[source]#
- Returns:
- transformTransform
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
- valign{'center', 'top', 'bottom', 'baseline', 'center_baseline'}
The text vertical alignment.
- halign{'center', 'left', 'right'}
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_xaxis_text2_transform(pad)[source]#
- Returns:
- transformTransform
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
- valign{'center', 'top', 'bottom', 'baseline', 'center_baseline'}
The text vertical alignment.
- halign{'center', 'left', 'right'}
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_xaxis_transform(which='grid')[source]#
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.
- get_yaxis_text1_transform(pad)[source]#
- Returns:
- transformTransform
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
- valign{'center', 'top', 'bottom', 'baseline', 'center_baseline'}
The text vertical alignment.
- halign{'center', 'left', 'right'}
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_yaxis_text2_transform(pad)[source]#
- Returns:
- transformTransform
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
- valign{'center', 'top', 'bottom', 'baseline', 'center_baseline'}
The text vertical alignment.
- halign{'center', 'left', 'right'}
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_yaxis_transform(which='grid')[source]#
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.
- name = 'polar'#
- set(*, adjustable=<UNSET>, agg_filter=<UNSET>, alpha=<UNSET>, anchor=<UNSET>, animated=<UNSET>, aspect=<UNSET>, autoscale_on=<UNSET>, autoscalex_on=<UNSET>, autoscaley_on=<UNSET>, axes_locator=<UNSET>, axisbelow=<UNSET>, box_aspect=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, facecolor=<UNSET>, frame_on=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, label=<UNSET>, mouseover=<UNSET>, navigate=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, position=<UNSET>, prop_cycle=<UNSET>, rasterization_zorder=<UNSET>, rasterized=<UNSET>, rgrids=<UNSET>, rlabel_position=<UNSET>, rlim=<UNSET>, rmax=<UNSET>, rmin=<UNSET>, rorigin=<UNSET>, rscale=<UNSET>, rticks=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, theta_direction=<UNSET>, theta_offset=<UNSET>, theta_zero_location=<UNSET>, thetagrids=<UNSET>, thetalim=<UNSET>, thetamax=<UNSET>, thetamin=<UNSET>, title=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, xbound=<UNSET>, xlabel=<UNSET>, xlim=<UNSET>, xmargin=<UNSET>, xscale=<UNSET>, xticklabels=<UNSET>, xticks=<UNSET>, ybound=<UNSET>, ylabel=<UNSET>, ylim=<UNSET>, ymargin=<UNSET>, yscale=<UNSET>, yticklabels=<UNSET>, yticks=<UNSET>, zorder=<UNSET>)[source]#
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
facecolor
or fccolor
bool
str
bool
object
bool
bool
unknown
None or bool or float or callable
[left, bottom, width, height] or
Bbox
unknown
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
str
tuple with floats, degrees
unknown
unknown
unknown
str
str
bool
unknown
str
(bottom: float, top: float)
float greater than -0.5
unknown
unknown
unknown
unknown
str
(bottom: float, top: float)
float greater than -0.5
unknown
unknown
unknown
float
- set_rgrids(radii, labels=None, angle=None, fmt=None, **kwargs)[source]#
Set the radial gridlines on a polar plot.
- Parameters:
- radiituple with floats
The radii for the radial gridlines
- labelstuple with strings or None
The labels to use at each radial gridline. The
matplotlib.ticker.ScalarFormatter
will be used if None.- anglefloat
The angular position of the radius labels in degrees.
- fmtstr or None
Format string used in
matplotlib.ticker.FormatStrFormatter
. For example '%f'.
- Returns:
- lineslist of
lines.Line2D
The radial gridlines.
- labelslist of
text.Text
The tick labels.
- lineslist of
- Other Parameters:
- **kwargs
kwargs are optional
Text
properties for the labels.
- set_rlabel_position(value)[source]#
Update the theta position of the radius labels.
- Parameters:
- valuenumber
The angular position of the radius labels in degrees.
- set_rlim(bottom=None, top=None, *, emit=True, auto=False, **kwargs)[source]#
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_theta_direction(direction)[source]#
Set the direction in which theta increases.
- clockwise, -1:
Theta increases in the clockwise direction
- counterclockwise, anticlockwise, 1:
Theta increases in the counterclockwise direction
- set_theta_zero_location(loc, offset=0.0)[source]#
Set the location of theta's zero.
This simply calls
set_theta_offset
with the correct value in radians.- Parameters:
- locstr
May be one of "N", "NW", "W", "SW", "S", "SE", "E", or "NE".
- offsetfloat, default: 0
An offset in degrees to apply from the specified loc. Note: this offset is always applied counter-clockwise regardless of the direction setting.
- set_thetagrids(angles, labels=None, fmt=None, **kwargs)[source]#
Set the theta gridlines in a polar plot.
- Parameters:
- anglestuple with floats, degrees
The angles of the theta gridlines.
- labelstuple with strings or None
The labels to use at each theta gridline. The
projections.polar.ThetaFormatter
will be used if None.- fmtstr or None
Format string used in
matplotlib.ticker.FormatStrFormatter
. For example '%f'. Note that the angle that is used is in radians.
- Returns:
- lineslist of
lines.Line2D
The theta gridlines.
- labelslist of
text.Text
The tick labels.
- lineslist of
- Other Parameters:
- **kwargs
kwargs are optional
Text
properties for the labels.
- set_thetalim(*args, **kwargs)[source]#
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_yscale(*args, **kwargs)[source]#
Set the yaxis' scale.
- Parameters:
- value{"linear", "log", "symlog", "logit", ...} or
ScaleBase
The axis scale type to apply.
- **kwargs
Different keyword arguments are accepted, depending on the scale. See the respective class keyword arguments:
- value{"linear", "log", "symlog", "logit", ...} or
Notes
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(x, y, button)[source]#
Called when a pan operation has started.
- Parameters:
- x, yfloat
The mouse coordinates in display coords.
- button
MouseButton
The pressed mouse button.
Notes
This is intended to be overridden by new projection types.
- class matplotlib.projections.polar.PolarTransform(axis=None, use_rmin=True, _apply_theta_transforms=True)[source]#
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 handle positioning in screen space).Path segments at a fixed radius are automatically transformed to circular arcs as long as
path._interpolation_steps > 1
.- Parameters:
- shorthand_namestr
A string representing the "name" of the transform. The name carries no significance other than to improve the readability of
str(transform)
when DEBUG=True.
- has_inverse = True#
True if this transform has a corresponding inverse transform.
- input_dims = 2#
The number of input dimensions of this transform. Must be overridden (with integers) in the subclass.
- inverted()[source]#
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.
- output_dims = 2#
The number of output dimensions of this transform. Must be overridden (with integers) in the subclass.
- transform_non_affine(tr)[source]#
Apply only the non-affine part of this transformation.
transform(values)
is always equivalent totransform_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.- Parameters:
- valuesarray
The input values as NumPy array of length
input_dims
or shape (N xinput_dims
).
- Returns:
- array
The output values as NumPy array of length
output_dims
or shape (N xoutput_dims
), depending on the input.
- class matplotlib.projections.polar.RadialAxis(*args, **kwargs)[source]#
Bases:
YAxis
A radial Axis.
This overrides certain properties of a
YAxis
to provide special-casing for a radial axis.- Parameters:
- axes
matplotlib.axes.Axes
The
Axes
to which the created Axis belongs.- pickradiusfloat
The acceptance radius for containment tests. See also
Axis.contains
.
- axes
- axis_name = 'radius'#
Read-only name identifying the axis.
- clear()[source]#
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(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, data_interval=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, inverted=<UNSET>, label=<UNSET>, label_coords=<UNSET>, label_position=<UNSET>, label_text=<UNSET>, major_formatter=<UNSET>, major_locator=<UNSET>, minor_formatter=<UNSET>, minor_locator=<UNSET>, mouseover=<UNSET>, offset_position=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, pickradius=<UNSET>, rasterized=<UNSET>, remove_overlapping_locs=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, tick_params=<UNSET>, ticklabels=<UNSET>, ticks=<UNSET>, ticks_position=<UNSET>, transform=<UNSET>, units=<UNSET>, url=<UNSET>, view_interval=<UNSET>, visible=<UNSET>, zorder=<UNSET>)[source]#
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
Formatter
,str
, or functionFormatter
,str
, or functionbool
{'left', 'right'}
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
Text
slist of floats
{'left', 'right', 'both', 'default', 'none'}
units tag
str
unknown
bool
float
- class matplotlib.projections.polar.RadialLocator(base, axes=None)[source]#
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).- nonsingular(vmin, vmax)[source]#
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.
- class matplotlib.projections.polar.RadialTick(*args, **kwargs)[source]#
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(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, label=<UNSET>, label1=<UNSET>, label2=<UNSET>, mouseover=<UNSET>, pad=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, zorder=<UNSET>)[source]#
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
str
str
str
bool
float
None or bool or float or callable
bool
(scale: float, length: float, randomness: float)
bool or None
str
bool
float
- class matplotlib.projections.polar.ThetaAxis(*args, **kwargs)[source]#
Bases:
XAxis
A theta Axis.
This overrides certain properties of an
XAxis
to provide special-casing for an angular axis.- Parameters:
- axes
matplotlib.axes.Axes
The
Axes
to which the created Axis belongs.- pickradiusfloat
The acceptance radius for containment tests. See also
Axis.contains
.
- axes
- axis_name = 'theta'#
Read-only name identifying the axis.
- clear()[source]#
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(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, data_interval=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, inverted=<UNSET>, label=<UNSET>, label_coords=<UNSET>, label_position=<UNSET>, label_text=<UNSET>, major_formatter=<UNSET>, major_locator=<UNSET>, minor_formatter=<UNSET>, minor_locator=<UNSET>, mouseover=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, pickradius=<UNSET>, rasterized=<UNSET>, remove_overlapping_locs=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, tick_params=<UNSET>, ticklabels=<UNSET>, ticks=<UNSET>, ticks_position=<UNSET>, transform=<UNSET>, units=<UNSET>, url=<UNSET>, view_interval=<UNSET>, visible=<UNSET>, zorder=<UNSET>)[source]#
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
Formatter
,str
, or functionFormatter
,str
, or functionbool
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
Text
slist of floats
{'top', 'bottom', 'both', 'default', 'none'}
units tag
str
unknown
bool
float
- class matplotlib.projections.polar.ThetaFormatter[source]#
Bases:
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:
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.
- class matplotlib.projections.polar.ThetaTick(axes, *args, **kwargs)[source]#
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(*, agg_filter=<UNSET>, alpha=<UNSET>, animated=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, label=<UNSET>, label1=<UNSET>, label2=<UNSET>, mouseover=<UNSET>, pad=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, zorder=<UNSET>)[source]#
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
str
str
str
bool
float
None or bool or float or callable
bool
(scale: float, length: float, randomness: float)
bool or None
str
bool
float
matplotlib.projections.geo
#
- class matplotlib.projections.geo.AitoffAxes(*args, **kwargs)[source]#
Bases:
GeoAxes
Build an Axes in a figure.
- Parameters:
- fig
Figure
The Axes is built in the
Figure
fig.- recttuple (left, bottom, width, height).
The Axes is built in the rectangle rect. rect is in
Figure
coordinates.- sharex, sharey
Axes
, optional The x or y
axis
is shared with the x or y axis in the inputAxes
.- frameonbool, default: True
Whether the Axes frame is visible.
- box_aspectfloat, optional
Set a fixed aspect for the Axes box, i.e. the ratio of height to width. See
set_box_aspect
for details.- **kwargs
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
facecolor
or fccolor
bool
str
bool
object
bool
bool
unknown
None or bool or float or callable
[left, bottom, width, height] or
Bbox
unknown
float or None
bool
(scale: float, length: float, randomness: float)
bool or None
str
str
bool
unknown
str
(bottom: float, top: float)
float greater than -0.5
unknown
unknown
unknown
unknown
str
(bottom: float, top: float)
float greater than -0.5
unknown
unknown
unknown
float
- fig
- Returns:
- class AitoffTransform(resolution)[source]#
Bases:
_GeoTransform
The base Aitoff transform.
Create a new geographical transform.
Resolution is the number of steps to interpolate between each input line segment to approximate its path in curved space.
- has_inverse = True#
True if this transform has a corresponding inverse transform.
- inverted()[source]#
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.
- transform_non_affine(ll)[source]#
Apply only the non-affine part of this transformation.
transform(values)
is always equivalent totransform_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.- Parameters:
- valuesarray
The input values as NumPy array of length
input_dims
or shape (N xinput_dims
).
- Returns:
- array
The output values as NumPy array of length
output_dims
or shape (N xoutput_dims
), depending on the input.
- class InvertedAitoffTransform(resolution)[source]#
Bases:
_GeoTransform
Create a new geographical transform.
Resolution is the number of steps to interpolate between each input line segment to approximate its path in curved space.
- has_inverse = True#
True if this transform has a corresponding inverse transform.
- inverted()[source]#
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.
- transform_non_affine(xy)[source]#
Apply only the non-affine part of this transformation.
transform(values)
is always equivalent totransform_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.- Parameters:
- valuesarray
The input values as NumPy array of length
input_dims
or shape (N xinput_dims
).
- Returns:
- array
The output values as NumPy array of length
output_dims
or shape (N xoutput_dims
), depending on the input.
- name = 'aitoff'#
- set(*, adjustable=<UNSET>, agg_filter=<UNSET>, alpha=<UNSET>, anchor=<UNSET>, animated=<UNSET>, aspect=<UNSET>, autoscale_on=<UNSET>, autoscalex_on=<UNSET>, autoscaley_on=<UNSET>, axes_locator=<UNSET>, axisbelow=<UNSET>, box_aspect=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, facecolor=<UNSET>, frame_on=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, label=<UNSET>, latitude_grid=<UNSET>, longitude_grid=<UNSET>, longitude_grid_ends=<UNSET>, mouseover=<UNSET>, navigate=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, position=<UNSET>, prop_cycle=<UNSET>, rasterization_zorder=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, title=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, xbound=<UNSET>, xlabel=<UNSET>, xlim=<UNSET>, xmargin=<UNSET>, xscale=<UNSET>, xticklabels=<UNSET>, xticks=<UNSET>, ybound=<UNSET>, ylabel=<UNSET>, ylim=<UNSET>, ymargin=<UNSET>, yscale=<UNSET>, yticklabels=<UNSET>, yticks=<UNSET>, zorder=<UNSET>)[source]#
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
facecolor
or fccolor
bool
str
bool
object
unknown
unknown
unknown
bool
bool
unknown
None or bool or float or callable
[left, bottom, width, height] or
Bbox
unknown
float or None
bool
(scale: float, length: float, randomness: float)
bool or None
str
str
bool
unknown
str
unknown
float greater than -0.5
unknown
unknown
unknown
unknown
str
unknown
float greater than -0.5
unknown
unknown
unknown
float
- class matplotlib.projections.geo.GeoAxes(fig, rect, *, facecolor=None, frameon=True, sharex=None, sharey=None, label='', xscale=None, yscale=None, box_aspect=None, **kwargs)[source]#
Bases:
Axes
An abstract base class for geographic projections.
Build an Axes in a figure.
- Parameters:
- fig
Figure
The Axes is built in the
Figure
fig.- recttuple (left, bottom, width, height).
The Axes is built in the rectangle rect. rect is in
Figure
coordinates.- sharex, sharey
Axes
, optional The x or y
axis
is shared with the x or y axis in the inputAxes
.- frameonbool, default: True
Whether the Axes frame is visible.
- box_aspectfloat, optional
Set a fixed aspect for the Axes box, i.e. the ratio of height to width. See
set_box_aspect
for details.- **kwargs
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
facecolor
or fccolor
bool
str
bool
object
bool
bool
unknown
None or bool or float or callable
[left, bottom, width, height] or
Bbox
unknown
float or None
bool
(scale: float, length: float, randomness: float)
bool or None
str
str
bool
unknown
str
(bottom: float, top: float)
float greater than -0.5
unknown
unknown
unknown
unknown
str
(bottom: float, top: float)
float greater than -0.5
unknown
unknown
unknown
float
- fig
- Returns:
- RESOLUTION = 75#
- class ThetaFormatter(round_to=1.0)[source]#
Bases:
Formatter
Used to format the theta tick labels. Converts the native unit of radians into degrees and adds a degree symbol.
- can_pan()[source]#
Return whether this axes supports the pan/zoom button functionality.
This axes object does not support interactive pan/zoom.
- can_zoom()[source]#
Return whether this axes supports the zoom box button functionality.
This axes object does not support interactive zoom box.
- drag_pan(button, key, x, y)[source]#
Called when the mouse moves during a pan operation.
- Parameters:
- button
MouseButton
The pressed mouse button.
- keystr or None
The pressed key, if any.
- x, yfloat
The mouse coordinates in display coords.
- button
Notes
This is intended to be overridden by new projection types.
- end_pan()[source]#
Called when a pan operation completes (when the mouse button is up.)
Notes
This is intended to be overridden by new projection types.
- get_xaxis_text1_transform(pad)[source]#
- Returns:
- transformTransform
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
- valign{'center', 'top', 'bottom', 'baseline', 'center_baseline'}
The text vertical alignment.
- halign{'center', 'left', 'right'}
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_xaxis_text2_transform(pad)[source]#
- Returns:
- transformTransform
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
- valign{'center', 'top', 'bottom', 'baseline', 'center_baseline'}
The text vertical alignment.
- halign{'center', 'left', 'right'}
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_xaxis_transform(which='grid')[source]#
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.
- get_yaxis_text1_transform(pad)[source]#
- Returns:
- transformTransform
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
- valign{'center', 'top', 'bottom', 'baseline', 'center_baseline'}
The text vertical alignment.
- halign{'center', 'left', 'right'}
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_yaxis_text2_transform(pad)[source]#
- Returns:
- transformTransform
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
- valign{'center', 'top', 'bottom', 'baseline', 'center_baseline'}
The text vertical alignment.
- halign{'center', 'left', 'right'}
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_yaxis_transform(which='grid')[source]#
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(*, adjustable=<UNSET>, agg_filter=<UNSET>, alpha=<UNSET>, anchor=<UNSET>, animated=<UNSET>, aspect=<UNSET>, autoscale_on=<UNSET>, autoscalex_on=<UNSET>, autoscaley_on=<UNSET>, axes_locator=<UNSET>, axisbelow=<UNSET>, box_aspect=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, facecolor=<UNSET>, frame_on=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, label=<UNSET>, latitude_grid=<UNSET>, longitude_grid=<UNSET>, longitude_grid_ends=<UNSET>, mouseover=<UNSET>, navigate=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, position=<UNSET>, prop_cycle=<UNSET>, rasterization_zorder=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, title=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, xbound=<UNSET>, xlabel=<UNSET>, xlim=<UNSET>, xmargin=<UNSET>, xscale=<UNSET>, xticklabels=<UNSET>, xticks=<UNSET>, ybound=<UNSET>, ylabel=<UNSET>, ylim=<UNSET>, ymargin=<UNSET>, yscale=<UNSET>, yticklabels=<UNSET>, yticks=<UNSET>, zorder=<UNSET>)[source]#
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
facecolor
or fccolor
bool
str
bool
object
unknown
unknown
unknown
bool
bool
unknown
None or bool or float or callable
[left, bottom, width, height] or
Bbox
unknown
float or None
bool
(scale: float, length: float, randomness: float)
bool or None
str
str
bool
unknown
str
unknown
float greater than -0.5
unknown
unknown
unknown
unknown
str
unknown
float greater than -0.5
unknown
unknown
unknown
float
- set_longitude_grid_ends(degrees)[source]#
Set the latitude(s) at which to stop drawing the longitude grids.
- set_xscale(*args, **kwargs)[source]#
Set the xaxis' scale.
- Parameters:
- value{"linear", "log", "symlog", "logit", ...} or
ScaleBase
The axis scale type to apply.
- **kwargs
Different keyword arguments are accepted, depending on the scale. See the respective class keyword arguments:
- value{"linear", "log", "symlog", "logit", ...} or
Notes
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_yscale(*args, **kwargs)[source]#
Set the yaxis' scale.
- Parameters:
- value{"linear", "log", "symlog", "logit", ...} or
ScaleBase
The axis scale type to apply.
- **kwargs
Different keyword arguments are accepted, depending on the scale. See the respective class keyword arguments:
- value{"linear", "log", "symlog", "logit", ...} or
Notes
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(x, y, button)[source]#
Called when a pan operation has started.
- Parameters:
- x, yfloat
The mouse coordinates in display coords.
- button
MouseButton
The pressed mouse button.
Notes
This is intended to be overridden by new projection types.
- class matplotlib.projections.geo.HammerAxes(*args, **kwargs)[source]#
Bases:
GeoAxes
Build an Axes in a figure.
- Parameters:
- fig
Figure
The Axes is built in the
Figure
fig.- recttuple (left, bottom, width, height).
The Axes is built in the rectangle rect. rect is in
Figure
coordinates.- sharex, sharey
Axes
, optional The x or y
axis
is shared with the x or y axis in the inputAxes
.- frameonbool, default: True
Whether the Axes frame is visible.
- box_aspectfloat, optional
Set a fixed aspect for the Axes box, i.e. the ratio of height to width. See
set_box_aspect
for details.- **kwargs
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
facecolor
or fccolor
bool
str
bool
object
bool
bool
unknown
None or bool or float or callable
[left, bottom, width, height] or
Bbox
unknown
float or None
bool
(scale: float, length: float, randomness: float)
bool or None
str
str
bool
unknown
str
(bottom: float, top: float)
float greater than -0.5
unknown
unknown
unknown
unknown
str
(bottom: float, top: float)
float greater than -0.5
unknown
unknown
unknown
float
- fig
- Returns:
- class HammerTransform(resolution)[source]#
Bases:
_GeoTransform
The base Hammer transform.
Create a new geographical transform.
Resolution is the number of steps to interpolate between each input line segment to approximate its path in curved space.
- has_inverse = True#
True if this transform has a corresponding inverse transform.
- inverted()[source]#
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.
- transform_non_affine(ll)[source]#
Apply only the non-affine part of this transformation.
transform(values)
is always equivalent totransform_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.- Parameters:
- valuesarray
The input values as NumPy array of length
input_dims
or shape (N xinput_dims
).
- Returns:
- array
The output values as NumPy array of length
output_dims
or shape (N xoutput_dims
), depending on the input.
- class InvertedHammerTransform(resolution)[source]#
Bases:
_GeoTransform
Create a new geographical transform.
Resolution is the number of steps to interpolate between each input line segment to approximate its path in curved space.
- has_inverse = True#
True if this transform has a corresponding inverse transform.
- inverted()[source]#
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.
- transform_non_affine(xy)[source]#
Apply only the non-affine part of this transformation.
transform(values)
is always equivalent totransform_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.- Parameters:
- valuesarray
The input values as NumPy array of length
input_dims
or shape (N xinput_dims
).
- Returns:
- array
The output values as NumPy array of length
output_dims
or shape (N xoutput_dims
), depending on the input.
- name = 'hammer'#
- set(*, adjustable=<UNSET>, agg_filter=<UNSET>, alpha=<UNSET>, anchor=<UNSET>, animated=<UNSET>, aspect=<UNSET>, autoscale_on=<UNSET>, autoscalex_on=<UNSET>, autoscaley_on=<UNSET>, axes_locator=<UNSET>, axisbelow=<UNSET>, box_aspect=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, facecolor=<UNSET>, frame_on=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, label=<UNSET>, latitude_grid=<UNSET>, longitude_grid=<UNSET>, longitude_grid_ends=<UNSET>, mouseover=<UNSET>, navigate=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, position=<UNSET>, prop_cycle=<UNSET>, rasterization_zorder=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, title=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, xbound=<UNSET>, xlabel=<UNSET>, xlim=<UNSET>, xmargin=<UNSET>, xscale=<UNSET>, xticklabels=<UNSET>, xticks=<UNSET>, ybound=<UNSET>, ylabel=<UNSET>, ylim=<UNSET>, ymargin=<UNSET>, yscale=<UNSET>, yticklabels=<UNSET>, yticks=<UNSET>, zorder=<UNSET>)[source]#
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
facecolor
or fccolor
bool
str
bool
object
unknown
unknown
unknown
bool
bool
unknown
None or bool or float or callable
[left, bottom, width, height] or
Bbox
unknown
float or None
bool
(scale: float, length: float, randomness: float)
bool or None
str
str
bool
unknown
str
unknown
float greater than -0.5
unknown
unknown
unknown
unknown
str
unknown
float greater than -0.5
unknown
unknown
unknown
float
- class matplotlib.projections.geo.LambertAxes(*args, center_longitude=0, center_latitude=0, **kwargs)[source]#
Bases:
GeoAxes
Build an Axes in a figure.
- Parameters:
- fig
Figure
The Axes is built in the
Figure
fig.- recttuple (left, bottom, width, height).
The Axes is built in the rectangle rect. rect is in
Figure
coordinates.- sharex, sharey
Axes
, optional The x or y
axis
is shared with the x or y axis in the inputAxes
.- frameonbool, default: True
Whether the Axes frame is visible.
- box_aspectfloat, optional
Set a fixed aspect for the Axes box, i.e. the ratio of height to width. See
set_box_aspect
for details.- **kwargs
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
facecolor
or fccolor
bool
str
bool
object
bool
bool
unknown
None or bool or float or callable
[left, bottom, width, height] or
Bbox
unknown
float or None
bool
(scale: float, length: float, randomness: float)
bool or None
str
str
bool
unknown
str
(bottom: float, top: float)
float greater than -0.5
unknown
unknown
unknown
unknown
str
(bottom: float, top: float)
float greater than -0.5
unknown
unknown
unknown
float
- fig
- Returns:
- class InvertedLambertTransform(center_longitude, center_latitude, resolution)[source]#
Bases:
_GeoTransform
Create a new geographical transform.
Resolution is the number of steps to interpolate between each input line segment to approximate its path in curved space.
- has_inverse = True#
True if this transform has a corresponding inverse transform.
- inverted()[source]#
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.
- transform_non_affine(xy)[source]#
Apply only the non-affine part of this transformation.
transform(values)
is always equivalent totransform_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.- Parameters:
- valuesarray
The input values as NumPy array of length
input_dims
or shape (N xinput_dims
).
- Returns:
- array
The output values as NumPy array of length
output_dims
or shape (N xoutput_dims
), depending on the input.
- class LambertTransform(center_longitude, center_latitude, resolution)[source]#
Bases:
_GeoTransform
The base Lambert transform.
Create a new Lambert transform. Resolution is the number of steps to interpolate between each input line segment to approximate its path in curved Lambert space.
- has_inverse = True#
True if this transform has a corresponding inverse transform.
- inverted()[source]#
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.
- transform_non_affine(ll)[source]#
Apply only the non-affine part of this transformation.
transform(values)
is always equivalent totransform_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.- Parameters:
- valuesarray
The input values as NumPy array of length
input_dims
or shape (N xinput_dims
).
- Returns:
- array
The output values as NumPy array of length
output_dims
or shape (N xoutput_dims
), depending on the input.
- name = 'lambert'#
- set(*, adjustable=<UNSET>, agg_filter=<UNSET>, alpha=<UNSET>, anchor=<UNSET>, animated=<UNSET>, aspect=<UNSET>, autoscale_on=<UNSET>, autoscalex_on=<UNSET>, autoscaley_on=<UNSET>, axes_locator=<UNSET>, axisbelow=<UNSET>, box_aspect=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, facecolor=<UNSET>, frame_on=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, label=<UNSET>, latitude_grid=<UNSET>, longitude_grid=<UNSET>, longitude_grid_ends=<UNSET>, mouseover=<UNSET>, navigate=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, position=<UNSET>, prop_cycle=<UNSET>, rasterization_zorder=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, title=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, xbound=<UNSET>, xlabel=<UNSET>, xlim=<UNSET>, xmargin=<UNSET>, xscale=<UNSET>, xticklabels=<UNSET>, xticks=<UNSET>, ybound=<UNSET>, ylabel=<UNSET>, ylim=<UNSET>, ymargin=<UNSET>, yscale=<UNSET>, yticklabels=<UNSET>, yticks=<UNSET>, zorder=<UNSET>)[source]#
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
facecolor
or fccolor
bool
str
bool
object
unknown
unknown
unknown
bool
bool
unknown
None or bool or float or callable
[left, bottom, width, height] or
Bbox
unknown
float or None
bool
(scale: float, length: float, randomness: float)
bool or None
str
str
bool
unknown
str
unknown
float greater than -0.5
unknown
unknown
unknown
unknown
str
unknown
float greater than -0.5
unknown
unknown
unknown
float
- class matplotlib.projections.geo.MollweideAxes(*args, **kwargs)[source]#
Bases:
GeoAxes
Build an Axes in a figure.
- Parameters:
- fig
Figure
The Axes is built in the
Figure
fig.- recttuple (left, bottom, width, height).
The Axes is built in the rectangle rect. rect is in
Figure
coordinates.- sharex, sharey
Axes
, optional The x or y
axis
is shared with the x or y axis in the inputAxes
.- frameonbool, default: True
Whether the Axes frame is visible.
- box_aspectfloat, optional
Set a fixed aspect for the Axes box, i.e. the ratio of height to width. See
set_box_aspect
for details.- **kwargs
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
facecolor
or fccolor
bool
str
bool
object
bool
bool
unknown
None or bool or float or callable
[left, bottom, width, height] or
Bbox
unknown
float or None
bool
(scale: float, length: float, randomness: float)
bool or None
str
str
bool
unknown
str
(bottom: float, top: float)
float greater than -0.5
unknown
unknown
unknown
unknown
str
(bottom: float, top: float)
float greater than -0.5
unknown
unknown
unknown
float
- fig
- Returns:
- class InvertedMollweideTransform(resolution)[source]#
Bases:
_GeoTransform
Create a new geographical transform.
Resolution is the number of steps to interpolate between each input line segment to approximate its path in curved space.
- has_inverse = True#
True if this transform has a corresponding inverse transform.
- inverted()[source]#
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.
- transform_non_affine(xy)[source]#
Apply only the non-affine part of this transformation.
transform(values)
is always equivalent totransform_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.- Parameters:
- valuesarray
The input values as NumPy array of length
input_dims
or shape (N xinput_dims
).
- Returns:
- array
The output values as NumPy array of length
output_dims
or shape (N xoutput_dims
), depending on the input.
- class MollweideTransform(resolution)[source]#
Bases:
_GeoTransform
The base Mollweide transform.
Create a new geographical transform.
Resolution is the number of steps to interpolate between each input line segment to approximate its path in curved space.
- has_inverse = True#
True if this transform has a corresponding inverse transform.
- inverted()[source]#
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.
- transform_non_affine(ll)[source]#
Apply only the non-affine part of this transformation.
transform(values)
is always equivalent totransform_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.- Parameters:
- valuesarray
The input values as NumPy array of length
input_dims
or shape (N xinput_dims
).
- Returns:
- array
The output values as NumPy array of length
output_dims
or shape (N xoutput_dims
), depending on the input.
- name = 'mollweide'#
- set(*, adjustable=<UNSET>, agg_filter=<UNSET>, alpha=<UNSET>, anchor=<UNSET>, animated=<UNSET>, aspect=<UNSET>, autoscale_on=<UNSET>, autoscalex_on=<UNSET>, autoscaley_on=<UNSET>, axes_locator=<UNSET>, axisbelow=<UNSET>, box_aspect=<UNSET>, clip_box=<UNSET>, clip_on=<UNSET>, clip_path=<UNSET>, facecolor=<UNSET>, frame_on=<UNSET>, gid=<UNSET>, in_layout=<UNSET>, label=<UNSET>, latitude_grid=<UNSET>, longitude_grid=<UNSET>, longitude_grid_ends=<UNSET>, mouseover=<UNSET>, navigate=<UNSET>, path_effects=<UNSET>, picker=<UNSET>, position=<UNSET>, prop_cycle=<UNSET>, rasterization_zorder=<UNSET>, rasterized=<UNSET>, sketch_params=<UNSET>, snap=<UNSET>, title=<UNSET>, transform=<UNSET>, url=<UNSET>, visible=<UNSET>, xbound=<UNSET>, xlabel=<UNSET>, xlim=<UNSET>, xmargin=<UNSET>, xscale=<UNSET>, xticklabels=<UNSET>, xticks=<UNSET>, ybound=<UNSET>, ylabel=<UNSET>, ylim=<UNSET>, ymargin=<UNSET>, yscale=<UNSET>, yticklabels=<UNSET>, yticks=<UNSET>, zorder=<UNSET>)[source]#
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
facecolor
or fccolor
bool
str
bool
object
unknown
unknown
unknown
bool
bool
unknown
None or bool or float or callable
[left, bottom, width, height] or
Bbox
unknown
float or None
bool
(scale: float, length: float, randomness: float)
bool or None
str
str
bool
unknown
str
unknown
float greater than -0.5
unknown
unknown
unknown
unknown
str
unknown
float greater than -0.5
unknown
unknown
unknown
float