PolarAxes¶
- class PolarAxes(*args, **kwargs)[source]¶
Bases:
proplot.axes.shared._SharedAxes
,proplot.axes.plot.PlotAxes
,matplotlib.projections.polar.PolarAxes
Axes subclass for plotting in polar coordinates. Adds the
format
method and overrides several existing methods.Important
This axes subclass can be used by passing
proj='polar'
to axes-creation commands likeadd_axes
,add_subplot
, andsubplots
.- Parameters
r0 (
float
, optional) – The radial origin. Default is0
.theta0 (
{'N', 'NW', 'W', 'SW', 'S', 'SE', 'E', 'NE'}
) – The zero azimuth location. Default isN
.thetadir (
{1, -1, 'anticlockwise', 'counterclockwise', 'clockwise'}
, optional) – The positive azimuth direction. Clockwise corresponds to-1
and anticlockwise corresponds to1
. Default is1
.thetamin, thetamax (
float
, optional) – The lower and upper azimuthal bounds in degrees. Ifthetamax != thetamin + 360
, this produces a sector plot.thetalim (
2-tuple
offloat
orNone
, optional) – Specifiesthetamin
andthetamax
at once.rmin, rmax (
float
, optional) – The inner and outer radial limits. Ifr0 != rmin
, this produces an annular plot.rlim (
2-tuple
offloat
orNone
, optional) – Specifiesrmin
andrmax
at once.rborder (
bool
, optional) – Whether to draw the polar axes border. Visibility of the “inner” radial spine and “start” and “end” azimuthal spines is controlled automatically by matplotlib.thetagrid, rgrid, grid (
bool
, optional) – Whether to draw major gridlines for the azimuthal and radial axis. Usegrid
to toggle both.thetagridminor, rgridminor, gridminor (
bool
, optional) – Whether to draw minor gridlines for the azimuthal and radial axis. Usegridminor
to toggle both.thetalocator, rlocator (
locator-spec
, optional) – Used to determine the azimuthal and radial gridline positions. Passed to theLocator
constructor. Can be float, list of float, string, ormatplotlib.ticker.Locator
instance.thetalines, rlines – Aliases for
thetalocator
,rlocator
.thetalocator_kw, rlocator_kw (dict-like, optional) – The azimuthal and radial locator settings. Passed to
Locator
.thetaminorlocator, rminorlocator (optional) – As for
thetalocator
,rlocator
, but for the minor gridlines.thetaminorticks, rminorticks (optional) – Aliases for
thetaminorlocator
,rminorlocator
.thetaminorlocator_kw, rminorlocator_kw – As for
thetalocator_kw
,rlocator_kw
, but for the minor locator.rlabelpos (
float
, optional) – The azimuth at which radial coordinates are labeled.thetaformatter, rformatter (
formatter-spec
, optional) – Used to determine the azimuthal and radial label format. Passed to theFormatter
constructor. Can be string, list of string, ormatplotlib.ticker.Formatter
instance. Use[]
,'null'
, or'none'
for no labels.thetalabels, rlabels (optional) – Aliases for
thetaformatter
,rformatter
.thetaformatter_kw, rformatter_kw (dict-like, optional) – The azimuthal and radial label formatter settings. Passed to
Formatter
.labelpad (
unit-spec
, optional) – The padding between the axes edge and the radial and azimuthal labels. Default isrc['grid.labelpad']
. If float, units are points. If string, interpreted byunits
.color (
color-spec
, optional) – Color for the axes edge. Propagates togridlabelcolor
unless specified otherwise (similar toproplot.axes.CartesianAxes.format
).thetagridcolor, rgridcolor, gridcolor (
color-spec
, optional) – Color for the major and minor azimuthal and radial gridlines. Usegridcolor
to set both at once.gridlabelcolor (
color-spec
, optional) – Color for the grid labels. Inherits fromcolor
by default.*args, **kwargs – Passed to
proplot.axes.Axes
.
- Other Parameters
title (
str
, optional) – The axes title.abc (
bool
orstr
, optional) – The “a-b-c” subplot label style. Must contain the charactera
orA
, for example'a.'
, or'A'
. IfTrue
then the default style of'a'
is used. Thea
orA
is replaced with the alphabetic character matching thenumber
. Ifnumber
is greater than 26, the characters loop around to a, …, z, aa, …, zz, aaa, …, zzz, etc.abcloc, titleloc (
str
, optional) – Strings indicating the location for the a-b-c label and main title. The following locations are valid (defaults arerc['abc.loc']
='left'
andrc['title.loc']
='center'
):Location
Valid keys
center above axes
'center'
,'c'
left above axes
'left'
,'l'
right above axes
'right'
,'r'
lower center inside axes
'lower center'
,'lc'
upper center inside axes
'upper center'
,'uc'
upper right inside axes
'upper right'
,'ur'
upper left inside axes
'upper left'
,'ul'
lower left inside axes
'lower left'
,'ll'
lower right inside axes
'lower right'
,'lr'
abcborder, titleborder (
bool
, optional) – Whether to draw a white border around titles and a-b-c labels positioned inside the axes. This can help them stand out on top of artists plotted inside the axes. Defaults arerc['abc.border']
=True
andrc['title.border']
=True
.abcbbox, titlebbox (
bool
, optional) – Whether to draw a white bbox around titles and a-b-c labels positioned inside the axes. This can help them stand out on top of artists plotted inside the axes. Defaults arerc['abc.bbox']
=False
andrc['title.bbox']
=False
.abc_kw, title_kw (dict-like, optional) – Additional settings used to update the a-b-c label and title with
text.update()
.titlepad (
float
, optional) – The padding for the inner and outer titles and a-b-c labels in arbitrary units (default is points). Default isrc['title.pad']
=5.0
.titleabove (
bool
, optional) – Whether to try to put outer titles and a-b-c labels above panels, colorbars, or legends that are above the axes. Default isrc['title.above']
=True
.abctitlepad (
float
, optional) – The horizontal padding between the a-b-c label and title when they are in the same location. Default isrc['abc.titlepad']
=4.0
.ltitle, ctitle, rtitle, ultitle, uctitle, urtitle, lltitle, lctitle, lrtitle (
str
, optional) – Shorthands for the below keywords.lefttitle, centertitle, righttitle, upperlefttitle, uppercentertitle, upperrighttitle, lowerlefttitle, lowercentertitle, lowerrighttitle (
str
,optoinal
) – Additional titles in specific positions. This works as an alternative to theax.format(title='Title', titleloc=loc)
workflow and permits adding more than one title-like label for a single axes.a, alpha, fc, facecolor, ec, edgecolor, lw, linewidth, ls, linestyle (optional) – Additional settings applied to the background patch, and their shorthands. Defaults are
rc['axes.alpha']
,rc['axes.facecolor']
,rc['axes.edgecolor']
,rc['axes.linewidth']
, and'-'
, respectively.rc_mode (
int
, optional) – The context mode passed tocontext
.rc_kw (dict-like, optional) – An alternative to passing extra keyword arguments. See below.
**kwargs – Passed to
proplot.config.Configurator.context
and used to update the axes-relevantrc
settings. For example,abc='A.'
modifies therc.abc
setting,titleloc='left'
modifies therc['title.loc']
setting,gridminor=True
modifies therc.gridminor
setting, andgridbelow=True
modifies therc['grid.below']
setting. Many of the keyword arguments documented above are actually applied by updating therc
settings then retrieving the updated settings.
See also
PolarAxes.format
,proplot.axes.Axes
,proplot.axes.PlotAxes
,matplotlib.projections.PolarAxes
,proplot.figure.Figure.subplot
,proplot.figure.Figure.add_subplot
Methods Summary
format
()Modify axes limits, radial and azimuthal gridlines, and more.