csep.utils.plots.plot_spatial_dataset

csep.utils.plots.plot_spatial_dataset(gridded, region, ax=None, show=False, extent=None, set_global=False, plot_args=None)[source]

Plot spatial dataset such as data from a gridded forecast

Parameters:
  • gridded (2D numpy.array) – Values according to region,

  • region (CartesianGrid2D) – Region in which gridded values are contained

  • show (bool) – Flag if the figure is displayed

  • extent (list) – default forecast.region.get_bbox()

  • set_global (bool) – Display the complete globe as basemap

  • plot_args (dict) –

    matplotlib and cartopy plot arguments. Dict keys are str, whose values can be:

    • figsize:

      tuple/list - default [6.4, 4.8]

    • title:

      str - default None

    • title_size:

      int - default 10

    • filename:

      str - default None

    • projection:

      cartopy.crs.Projection - default cartopy.crs.PlateCarree

    • grid:

      bool - default True

    • grid_labels:

      bool - default True

    • grid_fontsize:

      float - default 10.0

    • basemap:

      str. Possible values are: stock_img, stamen_terrain, stamen_terrain-background, google-satellite, ESRI_terrain, ESRI_imagery, ESRI_relief, ESRI_topo, ESRI_terrain, or webservice link. Default is None

    • coastline:

      bool - Flag to plot coastline. default True,

    • borders:

      bool - Flag to plot country borders. default False,

    • region_border:

      bool - Flag to plot the dataset region border. default True,

    • tile_scaling:

      str/int. Zoom level (1-12) of the basemap tiles. If ‘auto’, is automatically derived from extent

    • linewidth:

      float - Line width of borders and coast lines. default 1.5,

    • linecolor:

      str - Color of borders and coast lines. default ‘black’,

    • cmap:

      str/pyplot.colors.Colormap - default ‘viridis’

    • clim:

      list - Range of the colorbar. default None

    • clabel:

      str - Label of the colorbar. default None

    • clabel_fontsize:

      float - default None

    • cticks_fontsize:

      float - default None

    • alpha:

      float - default 1

    • alpha_exp:

      float - Exponent for the alpha func (recommended between 0.4 and 1). default 0

Returns:

matplotlib.pyplot.ax object