PolarAxes

class PolarAxes(*args, **kwargs)[source]

Bases: _SharedAxes, PlotAxes, 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 like add_axes, add_subplot, and subplots.

Parameters
  • *args – Passed to matplotlib.axes.Axes.

  • r0 (float, default: 0) – The radial origin.

  • theta0 ({'N', 'NW', 'W', 'SW', 'S', 'SE', 'E', 'NE'}, optional) – The zero azimuth location.

  • thetadir ({1, -1, 'anticlockwise', 'counterclockwise', 'clockwise'}, optional) – The positive azimuth direction. Clockwise corresponds to -1 and anticlockwise corresponds to 1.

  • thetamin, thetamax (float, optional) – The lower and upper azimuthal bounds in degrees. If thetamax != thetamin + 360, this produces a sector plot.

  • thetalim (2-tuple of float or None, optional) – Specifies thetamin and thetamax at once.

  • rmin, rmax (float, optional) – The inner and outer radial limits. If r0 != rmin, this produces an annular plot.

  • rlim (2-tuple of float or None, optional) – Specifies rmin and rmax 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. Use the keyword grid to toggle both.

  • thetagridminor, rgridminor, gridminor (bool, optional) – Whether to draw minor gridlines for the azimuthal and radial axis. Use the keyword gridminor to toggle both.

  • thetagridcolor, rgridcolor, gridcolor (color-spec, optional) – Color for the major and minor azimuthal and radial gridlines. Use the keyword gridcolor to set both at once.

  • thetalocator, rlocator (locator-spec, optional) – Used to determine the azimuthal and radial gridline positions. Passed to the Locator constructor. Can be float, list of float, string, or matplotlib.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 the Formatter constructor. Can be string, list of string, or matplotlib.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.

  • color (color-spec, default: rc['meta.color'] = 'black') – Color for the axes edge. Propagates to labelcolor unless specified otherwise (similar to proplot.axes.CartesianAxes.format).

  • labelcolor, gridlabelcolor (color-spec, default: color or rc['grid.labelcolor'] = 'black') – Color for the gridline labels.

  • labelpad, gridlabelpad (unit-spec, default: rc['grid.labelpad'] = 3.0) – The padding between the axes edge and the radial and azimuthal labels. If float, units are points. If string, interpreted by units.

  • labelsize, gridlabelsize (unit-spec or str, default: rc['grid.labelsize'] = 'medium') – Font size for the gridline labels. If float, units are points. If string, interpreted by units.

  • labelweight, gridlabelweight (str, default: rc['grid.labelweight'] = 'normal') – Font weight for the gridline labels.

Other Parameters
  • title (str or sequence, optional) – The axes title. Can optionally be a sequence strings, in which case the title will be selected from the sequence according to number.

  • abc (bool or str or sequence, default: rc.abc = False) – The “a-b-c” subplot label style. Must contain the character a or A, for example 'a.', or 'A'. If True then the default style of 'a' is used. The a or A is replaced with the alphabetic character matching the number. If number is greater than 26, the characters loop around to a, …, z, aa, …, zz, aaa, …, zzz, etc. Can also be a sequence of strings, in which case the “a-b-c” label will simply be selected from the sequence according to number.

  • abcloc, titleloc (str, default: rc['abc.loc'] = 'left', rc['title.loc'] = 'center') – Strings indicating the location for the a-b-c label and main title. The following locations are valid:

    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, default: rc['abc.border'] = True and rc['title.border'] = True) – 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.

  • abcbbox, titlebbox (bool, default: rc['abc.bbox'] = False and rc['title.bbox'] = False) – 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.

  • abc_kw, title_kw (dict-like, optional) – Additional settings used to update the a-b-c label and title with text.update().

  • titlepad (float, default: rc['title.pad'] = 5.0) – The padding for the inner and outer titles and a-b-c labels. If float, units are points. If string, interpreted by units.

  • titleabove (bool, default: rc['title.above'] = True) – Whether to try to put outer titles and a-b-c labels above panels, colorbars, or legends that are above the axes.

  • abctitlepad (float, default: rc['abc.titlepad'] = 4.0) – The horizontal padding between a-b-c labels and titles in the same location. If float, units are points. If string, interpreted by units.

  • ltitle, ctitle, rtitle, ultitle, uctitle, urtitle, lltitle, lctitle, lrtitle (str or sequence, optional) – Shorthands for the below keywords.

  • lefttitle, centertitle, righttitle, upperlefttitle, uppercentertitle, upperrighttitle, lowerlefttitle, lowercentertitle, lowerrighttitle (str or sequence, optional) – Additional titles in specific positions (see title for details). This works as an alternative to the ax.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 (default: rc['axes.alpha'] = None, rc['axes.facecolor'] = 'white', rc['axes.edgecolor'] = 'black', rc['axes.linewidth'] = 0.6, '-') – Additional settings applied to the background patch, and their shorthands. Their defaults values are the 'axes' properties.

  • rc_mode (int, optional) – The context mode passed to context.

  • rc_kw (dict-like, optional) – An alternative to passing extra keyword arguments. See below.

  • **kwargs – Remaining keyword arguments are passed to matplotlib.axes.Axes. Keyword arguments that match the name of an rc setting are passed to proplot.config.Configurator.context and used to update the axes. If the setting name has “dots” you can simply omit the dots. For example, abc='A.' modifies the rc.abc setting, titleloc='left' modifies the rc['title.loc'] setting, gridminor=True modifies the rc.gridminor setting, and gridbelow=True modifies the rc['grid.below'] setting. Many of the keyword arguments documented above are internally applied by retrieving settings passed to context.

Methods Summary

format()

Modify axes limits, radial and azimuthal gridlines, and more.