regionmask.Regions.plot

Regions.plot(*, ax: GeoAxes | None = None, projection=None, add_label: bool = True, label: Literal['number', 'name', 'abbrev'] = 'number', add_coastlines: bool = True, add_ocean: bool = False, line_kws: dict[str, Any] | None = None, text_kws: dict[str, Any] | None = None, resolution: Literal['110m', '50m', '10m'] = '110m', add_land: bool = False, coastline_kws: dict[str, Any] | None = None, ocean_kws: dict[str, Any] | None = None, land_kws: dict[str, Any] | None = None, label_multipolygon: Literal['largest', 'all'] = 'largest', tolerance: Literal['auto'] | float | None = 'auto') GeoAxes

plot region on cartopy axes

Parameters:
axaxes handle, optional

If given uses existing axes (needs to be a cartopy GeoAxes). If not given, uses the current axes or creates a new axes with the specified projection.

projectioncartopy projection, optional

Defines the projection of the map. If None uses ‘PlateCarree’. See cartopy home page.

add_labelbool, default: True

If true labels the regions.

label‘number’ | ‘name’ | ‘abbrev’, default: ‘number’

If ‘number’ labels the regions with numbers, if ‘name’ uses the long name of the regions, if ‘abbrev’ uses abbreviations of the regions.

add_coastlinesbool, default: None

If None or true plots coastlines. See coastline_kws.

add_oceanbool, default: False

If true adds the ocean feature. See ocean_kws.

line_kwsdict, default: None

Arguments passed to plot.

text_kwsdict, default, None

Arguments passed to the labels (ax.text).

resolution‘110m’ | ‘50m’ | ‘10m’, default: ‘110m’

Specify the resolution of the coastline and the ocean dataset. See cartopy for details.

add_landbool, default: False

If true adds the land feature. See land_kws.

coastline_kwsdict, default: None

Arguments passed to ax.coastlines(). If None uses color="0.4" and lw=0.5.

ocean_kwsdict, default: None

Arguments passed to ax.add_feature(OCEAN). Per default uses the cartopy ocean color and zorder=0.9, lw=0.

land_kwsdict, default: None

Arguments passed to ax.add_feature(LAND). Per default uses the cartopy land color and zorder=0.9, lw=0.

label_multipolygon‘largest’ | ‘all’, default: ‘largest’.

If ‘largest’ only adds a text label for the largest Polygon of a MultiPolygon. If ‘all’ adds text labels to all of them.

toleranceNone | ‘auto’ | float, default: ‘auto’.

Maximum length of drawn line segments. Can lead to better looking plots on certain maps.

  • None: draw original coordinates

  • float > 0: the maximum (euclidean) length of each line segment.

  • ‘auto’: The tolerance is automatically determined based on the log10 of the largest absolute coordinate. Defaults to 1 for lat/ lon coordinates.

Returns:
axaxes handle