polaris.ocean.viz.plot_transect

polaris.ocean.viz.plot_transect(ds_transect, mpas_field=None, out_filename=None, ax=None, title=None, vmin=None, vmax=None, colorbar_label=None, cmap=None, figsize=(12, 6), dpi=200, method='flat', outline_color='black', ssh_color=None, seafloor_color=None, interface_color=None, cell_boundary_color=None, linewidth=1.0, color_start_and_end=False, start_color='red', end_color='green')[source]

plot a transect showing the field on the MPAS-Ocean mesh and save to a file

Parameters
  • ds_transect (xarray.Dataset) – A transect dataset from polaris.ocean.viz.compute_transect()

  • mpas_field (xarray.DataArray) – The MPAS-Ocean 3D field to plot

  • out_filename (str, optional) – The png file to write out to

  • ax (matplotlib.axes.Axes) – Axes to plot to if making a multi-panel figure

  • title (str) – The title of the plot

  • vmin (float, optional) – The minimum values for the colorbar

  • vmax (float, optional) – The maximum values for the colorbar

  • colorbar_label (str, optional) – The colorbar label, or None if no colorbar is to be included. Use an empty string to display a colorbar without a label.

  • cmap (str, optional) – The name of a colormap to use

  • figsize (tuple, optional) – The size of the figure in inches

  • dpi (int, optional) – The dots per inch of the image

  • method ({'flat', 'bilinear'}, optional) – The type of interpolation to use in plots. flat means constant values over each MPAS cell. bilinear means smooth interpolation between horizontally between cell centers and vertical between the middle of layers.

  • outline_color (str or None, optional) – The color to use to outline the transect or None for no outline

  • ssh_color (str or None, optional) – The color to use to plot the SSH (sea surface height) or None if not plotting the SSH (except perhaps as part of the outline)

  • seafloor_color (str or None, optional) – The color to use to plot the seafloor depth or None if not plotting the seafloor depth (except perhaps as part of the outline)

  • interface_color (str or None, optional) – The color to use to plot interfaces between layers or None if not plotting the layer interfaces

  • cell_boundary_color (str or None, optional) – The color to use to plot vertical boundaries between cells or None if not plotting cell boundaries. Typically, cell_boundary_color will be used along with interface_color to outline cells both horizontally and vertically.

  • linewidth (float, optional) – The width of outlines, interfaces and cell boundaries

  • color_start_and_end (bool, optional) – Whether to color the left and right axes of the transect, which is useful if the transect is also being plotted in an inset or on top of a horizontal field

  • start_color (str, optional) – The color of left axis marking the start of the transect if plot_start_end == True

  • end_color (str, optional) – The color of right axis marking the end of the transect if plot_start_end == True