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 and context.

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 the Basemap 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. Use grid to toggle both.

  • longridminor, latgridminor (bool, optional) – Whether to draw “minor” longitude and latitude lines. Default is rc.gridminor = False. Use gridminor to toggle both.

  • lonlocator, latlocator (str, float, list of float, or Locator, optional) – Used to determine the longitude and latitude gridline locations. Passed to the Locator constructor. Can be string, float, list of float, or matplotlib.ticker.Locator instance. The defaults are custom proplot

    Locator 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 and latlocator but for the “minor” gridlines. The defaults are rc[‘grid.lonminorstep’] and rc[‘grid.latminorstep’].

  • lonminorlocator_kw, latminorlocator_kw, lonminorlines_kw, latminorlines_kw (optional) – As with lonminorlocator_kw and latminorlocator_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:

    1. Boolean True. Indicates left side for latitudes, bottom for longitudes.

    2. A string indicating the side names, e.g. 'lr' or 'bt'.

    3. A boolean 2-tuple indicating whether to draw labels on the (left, right) sides for longitudes, or (bottom, top) sides for latitudes.

    4. A boolean 4-tuple indicating whether to draw labels on the (left, right, bottom, top) sides, as in the basemap drawmeridians and drawparallels methods.

  • lonformatter, latformatter (str or Formatter, optional) – Formatter spec used to style longitude and latitude gridline labels. Passed to the Formatter constructor. Can be string, list of string, or matplotlib.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 are LongitudeFormatter and LatitudeFormatter 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 and rc[‘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 and LatitudeFormatter should use degrees-minutes-seconds for gridline labels on small scales in rectangular projections. Default is True.

  • 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 is rc[‘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, and rc.innerborders settings passed to context. The style can be modified using additional rc settings. For example, to change rc[‘land.color’], use ax.format(landcolor='green'), and to change rc[‘land.zorder’], use ax.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 using context.

  • **kwargs – Passed to Axes.format or passed to context and used to update axes rc settings. For example, abcstyle='A.' modifies the rc[‘abc.style’] setting.