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
Noneif 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.
flatmeans constant values over each MPAS cell.bilinearmeans 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
Nonefor no outlinessh_color (str or None, optional) – The color to use to plot the SSH (sea surface height) or
Noneif 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
Noneif 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
Noneif not plotting the layer interfacescell_boundary_color (str or None, optional) – The color to use to plot vertical boundaries between cells or
Noneif not plotting cell boundaries. Typically,cell_boundary_colorwill be used along withinterface_colorto 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 == Trueend_color (str, optional) – The color of right axis marking the end of the transect if
plot_start_end == True