mpas_tools.landice.visualization.plot_map

mpas_tools.landice.visualization.plot_map(data_path, variable, ax, time=0, cmap=None, vmin=None, vmax=None, norm=None, log_plot=False, mesh_file=None, triangles=None, plot_grounding_line=False, variable_name=None)[source]

Plot map of MALI output either by specifying a variable name or a pre-computed field.

Parameters:
  • data_path (str) – Path to .nc file containing variables to plot. May contain MALI mesh fields, or you can use the mesh_file argument.

  • variable (str or numpy.ndarray) – MALI variable to plot. If a string is specified, the variable with that name will be read from the .nc file at data_path. If a numpy array is given, that array will be plotted directly.

  • ax (matplotlib.axes._axes.Axes) – Axes on which to plot variable

  • time (int, optional) – Time index at which to plot variable.

  • cmap (str, optional) – Name of matplotlib colormap for multiple time levels of variable

  • vmin (float, optional) – Minimum value to use for plotting. If not specified, the 1st percentile value will be used (not weighted by cell area).

  • vmax (float, optional) – Maximum value to use for plotting. If not specified, the 99th percentile value will be used (not weighted by cell area).

  • log_plot (boolean, optional) – Whether to plot log10(variable)

  • mesh_file (str, optional) – Optional file used to specify mesh variables. If not provided, mesh variables will be read from data_path

  • triangles (matplotlib.tri._triangulation.Triangulation, optional) – Triangles to use for plotting. If not specified, they will be calculated.

  • plot_grounding_line (boolean, optional) – Whether to plot the grounding line along with variable.

  • variable_name (str) – Name to use for colorbar if specifying variable as a numpy array.

Returns:

  • var_plot (matplotlib.collections.PolyCollection) – Plot of variable

  • cbar (matplotlib.colorbar.Colorbar) – Colorbar object corresponded to var_plot

  • gl_plot (matplotlib.tri._tricontour.TriContourSet or None) – Contour object of the grounding line, if plot_grounding_line=True