monet.plots.make_spatial_contours

monet.plots.make_spatial_contours(modelvar, gridobj, date, m, dpi=None, savename='', discrete=True, ncolors=None, dtype='int', **kwargs)

Create a contour plot on a map with optional discrete colorbar.

Parameters:
  • modelvar (numpy.ndarray) – 2D model variable array to contour.

  • gridobj (object) – Object containing grid information with LAT and LON variables.

  • date (datetime.datetime) – Date/time for the plot title.

  • m (mpl_toolkits.basemap.Basemap) – Basemap instance for mapping.

  • dpi (int, optional) – Dots per inch for the figure if saving.

  • savename (str, default “”) – If provided, save the figure to this path with date appended.

  • discrete (bool, default True) – If True, use a discrete colorbar instead of a continuous one.

  • ncolors (int, optional) – Number of discrete colors when using discrete colorbar.

  • dtype (str, default “int”) – Data type for colorbar tick labels.

  • **kwargs – Additional arguments to pass to contourf. Must include ‘cmap’ and ‘levels’.

Returns:

The colorbar instance.

Return type:

matplotlib.colorbar.Colorbar