csep.plots.plot_basemap

csep.plots.plot_basemap(basemap=None, extent=None, coastline=True, borders=False, tile_depth='auto', set_global=False, projection=None, ax=None, show=False, **kwargs)[source]

Wrapper function for multiple Cartopy base plots, including access to standard raster web services and reading of filesystem geoTIFF.

Usage Tutorials

Parameters:
  • basemap (str, optional) – Possible values are: ‘stock_img’, ‘google-satellite’, ‘ESRI_terrain’, ‘ESRI_imagery’, ‘ESRI_relief’, ‘ESRI_topo’, a custom web service link, or a GeoTiff filepath. Defaults to None.

  • extent (list of float, optional) – [lon_min, lon_max, lat_min, lat_max]. Defaults to None.

  • coastline (bool, optional) – Flag to plot coastline. Defaults to True.

  • borders (bool, optional) – Flag to plot country borders. Defaults to False.

  • tile_depth (str or int, optional) – Zoom resolution level (1-12) of the basemap tiles. If ‘auto’, it is automatically derived from extent. Defaults to ‘auto’.

  • set_global (bool, optional) – Display the complete globe as basemap. Required by global forecasts. Defaults to False.

  • projection (cartopy.crs.Projection, optional) – Projection to be used in the basemap. It can be a cartopy projection instance, or approx for a quick approximation of Mercator. Defaults to PlateCarree if None.

  • ax (matplotlib.axes.Axes, optional) – Previously defined ax object. If None, a new axis is created. Defaults to None.

  • show (bool, optional) – If True, displays the plot. Defaults to False.

  • **kwargs (optional) –

    Additional keyword arguments to customize the plot:

    • figsize (tuple): The size of the figure.

    • coastline_color (str): Color for the coastlines.

    • coastline_linewidth (float): Line width for the coastlines.

    • borders_color (str): Color for the borders.

    • borders_linewidth (float): Line width for the borders.

    • grid (bool): Whether to show grid lines. Defaults to True.

    • grid_labels (bool): Whether to show grid labels.

    • grid_fontsize (int): Font size for the grid labels.

Returns:

The Matplotlib axes object with the plotted data.

Return type:

matplotlib.axes.Axes

Changed in version 0.8.0: Change tile_scaling to tile_depth. Reassigned many aesthetic args to kwargs. Modified automatic scaling with intermediate steps.

Added in version 0.8.0: Added functionality to use a TIFF image from filesystem as basemap