GeoAxes.format¶
-
GeoAxes.
format
(*, lonlim=None, latlim=None, boundinglat=None, longrid=None, latgrid=None, longridminor=None, latgridminor=None, lonlocator=None, lonlines=None, latlocator=None, latlines=None, latmax=None, lonminorlocator=None, lonminorlines=None, latminorlocator=None, latminorlines=None, lonlocator_kw=None, lonlines_kw=None, latlocator_kw=None, latlines_kw=None, lonminorlocator_kw=None, lonminorlines_kw=None, latminorlocator_kw=None, latminorlines_kw=None, lonformatter=None, latformatter=None, lonformatter_kw=None, latformatter_kw=None, labels=None, latlabels=None, lonlabels=None, loninline=None, latinline=None, rotatelabels=None, labelpad=None, dms=None, nsteps=None, patch_kw=None, **kwargs)[source]¶ Modify the longitude and latitude labels, longitude and latitude map limits, geographic features, and more. Unknown keyword arguments are passed to
Axes.format
andcontext
.- Parameters
lonlim, latlim ((float, float), optional) – For cartopy axes only. The approximate longitude and latitude boundaries of the map, applied with
set_extent
. Basemap axes extents must be declared when instantiating theBasemap
object.boundinglat (float, optional) – For cartopy axes only. The edge latitude for the circle bounding North Pole and South Pole-centered projections. Basemap bounding latitudes must be declared when instantiating the
Basemap
object.longrid, latgrid (bool, optional) – Whether to draw longitude and latitude gridlines. Default is
rc.grid
=True
. Usegrid
to toggle both.longridminor, latgridminor (bool, optional) – Whether to draw “minor” longitude and latitude lines. Default is
rc.gridminor
=False
. Usegridminor
to toggle both.lonlocator, latlocator (str, float, list of float, or
Locator
, optional) – Used to determine the longitude and latitude gridline locations. Passed to theLocator
constructor. Can be string, float, list of float, ormatplotlib.ticker.Locator
instance. The defaults are custom proplotLocator spec used to determine longitude and latitude gridline locations. If float, indicates the step size between longitude and latitude gridlines. If list of float, indicates the exact longitude and latitude gridline locations. Otherwise, the argument is interpreted by the
Locator
constructor, and the defaults are ProPlot’s custom longitude and latitude locators adapted from cartopy.lonlines, latlines (optional) – Aliases for
lonlocator
,latlocator
.lonlocator_kw, latlocator_kw (dict, optional) – Keyword argument dictionaries passed to the
Locator
class.lonlines_kw, latlines_kw (optional) – Aliases for
lonlocator_kw
,latlocator_kw
.lonminorlocator, latminorlocator, lonminorlines, latminorlines (optional) – As with
lonlocator
andlatlocator
but for the “minor” gridlines. The defaults arerc[‘grid.lonminorstep’]
andrc[‘grid.latminorstep’]
.lonminorlocator_kw, latminorlocator_kw, lonminorlines_kw, latminorlines_kw (optional) – As with
lonminorlocator_kw
andlatminorlocator_kw
but for the “minor” gridlines.latmax (float, optional) – The maximum absolute latitude for longitude and latitude gridlines. Longitude gridlines are cut off poleward of this latitude for all basemap projections and the subset of cartopy projections that support this feature. Default is
80
.latmax (float, optional) – Maximum absolute gridline latitude. Lines poleward of this latitude are cut off for all basemap projections and the subset of cartopy projections that support this feature.
labels (bool, optional) – Toggles longitude and latitude gridline labels on and off. Default is
rc[‘grid.labels’]
=False
.lonlabels, latlabels – Whether to label longitudes and latitudes, and on which sides of the map. There are four different options:
Boolean
True
. Indicates left side for latitudes, bottom for longitudes.A string indicating the side names, e.g.
'lr'
or'bt'
.A boolean 2-tuple indicating whether to draw labels on the
(left, right)
sides for longitudes, or(bottom, top)
sides for latitudes.A boolean 4-tuple indicating whether to draw labels on the
(left, right, bottom, top)
sides, as in the basemapdrawmeridians
anddrawparallels
methods.
lonformatter, latformatter (str or
Formatter
, optional) – Formatter spec used to style longitude and latitude gridline labels. Passed to theFormatter
constructor. Can be string, list of string, ormatplotlib.ticker.Formatter
instance. Use[]
or'null'
for no ticks. The defaults are the'deglon'
and'deglat'
AutoFormatter
presets. For cartopy rectangular projections, the defaults are cartopy’s fancy areLongitudeFormatter
andLatitudeFormatter
formatters with degrees-minutes-seconds support.lonformatter_kw, latformatter_kw (optional) – Keyword argument dictionaries passed to the
Formatter
class.loninline, latinline (bool, optional) – For cartopy axes only. Whether to draw inline longitude and latitude gridline labels. Defaults are
rc[‘grid.loninline’]
=False
andrc[‘grid.latinline’]
=False
.rotatelabels (bool, optional) – For cartopy axes only. Whether to rotate longitude and latitude gridline labels. Default is
rc[‘grid.rotatelabels’]
=False
.labelpad (float, optional) – For cartopy axes only. Controls the padding between the map boundary and longitude and latitude gridline labels. Default is
rc[‘grid.labelpad’]
.dms (bool, optional) – For cartopy axes only. Specifies whether the cartopy
LongitudeFormatter
andLatitudeFormatter
should use degrees-minutes-seconds for gridline labels on small scales in rectangular projections. Default isTrue
.nsteps (int, optional) – For cartopy axes only. Specifies the
cartopy.mpl.gridliner.Gridliner.n_steps
property, i.e. the number of interpolation steps used to draw gridlines. Default isrc[‘grid.nsteps’]
=250
.land, ocean, coast, rivers, lakes, borders, innerborders (bool, optional) – Toggles various geographic features. These are actually the
rc.land
,rc.ocean
,rc.coast
,rc.rivers
,rc.lakes
,rc.borders
, andrc.innerborders
settings passed tocontext
. The style can be modified using additionalrc
settings. For example, to changerc[‘land.color’]
, useax.format(landcolor='green')
, and to changerc[‘land.zorder’]
, useax.format(landzorder=4)
.reso ({‘lo’, ‘med’, ‘hi’, ‘x-hi’, ‘xx-hi’}) – For cartopy axes only. Resolution of geographic features. For basemap axes, this must be passed when the projection is created with
Proj
.patch_kw (dict-like, optional) – Keyword arguments used to update the background patch object. You can use this, for example, to set background hatching with
patch_kw={'hatch': 'xxx'}
.
- Other Parameters
rc_kw (dict, optional) – Dictionary containing
rc
settings applied to this axes usingcontext
.**kwargs – Passed to
Axes.format
or passed tocontext
and used to update axesrc
settings. For example,abcstyle='A.'
modifies therc[‘abc.style’]
setting.