polaris.viz.plot_horiz_field
- polaris.viz.plot_horiz_field(ds_mesh, field, out_file_name=None, ax=None, title=None, t_index=None, z_index=None, vmin=None, vmax=None, show_patch_edges=False, cmap=None, cmap_set_under=None, cmap_set_over=None, cmap_scale='linear', cmap_title=None, figsize=None, vert_dim='nVertLevels', field_mask=None, descriptor=None, transect_x=None, transect_y=None, transect_color='black', transect_start='red', transect_end='green', transect_linewidth=2.0, transect_markersize=12.0)[source]
Plot a horizontal field from a planar domain using x,y coordinates at a single time and depth slice.
- Parameters:
ds_mesh (xarray.Dataset) – A data set containing horizontal mesh variables
field (xarray.DataArray) – The data array to plot
out_file_name (str, optional) – The path to which the plot image should be written
ax (matplotlib.axes.Axes) – Axes to plot to if making a multi-panel figure
title (str, optional) – The title of the plot
vmin (float, optional) – The minimum values for the colorbar
vmax (float, optional) – The maximum values for the colorbar
show_patch_edges (boolean, optional) – If true, patches will be plotted with visible edges
t_index (int, optional) – The indices of
Time
axes to select for plotting. The default is 0 (initial time)z_index (int, optional) – The indices of
nVertLevels
axes to select for plotting. The default is 0 (top level)cmap (Colormap or str, optional) – A color map to plot
cmap_set_under (str or None, optional) – A color for low out-of-range values
cmap_set_over (str or None, optional) – A color for upper out-of-range values
cmap_scale ({'log', 'linear'}, optional) – Whether the colormap is logarithmic or linear
cmap_title (str, optional) – Title for color bar
figsize (tuple, optional) – The width and height of the figure in inches. Default is determined based on the aspect ratio of the domain.
vert_dim (str, optional) – Name of the vertical dimension
field_mask (xarray.DataArray, optional) – A
bool
mask indicating where thefield
is valid.descriptor (mosaic.Descriptor, optional) – Descriptor from a previous call to
plot_horiz_field()
transect_x (numpy.ndarray or xarray.DataArray, optional) – The x coordinates of a transect to plot on the
transect_y (numpy.ndarray or xarray.DataArray, optional) – The y coordinates of a transect
transect_color (str, optional) – The color of the transect line
transect_start (str or None, optional) – The color of a dot marking the start of the transect
transect_end (str or None, optional) – The color of a dot marking the end of the transect
transect_linewidth (float, optional) – The width of the transect line
transect_markersize (float, optional) – The size of the transect start and end markers
- Returns:
descriptor (mosaic.Descriptor) – For reuse with future plots. Patches are cached, so the Descriptor only needs to be created once per mesh file.