act.plotting.XSectionDisplay.plot_xsection#

XSectionDisplay.plot_xsection(field, dsname=None, x=None, y=None, subplot_index=(0,), sel_kwargs=None, isel_kwargs=None, set_title=None, **kwargs)[source]#

This function plots a cross section whose x and y coordinates are specified by the variable names either provided by the user or automatically detected by xarray.

Parameters:
  • field (str) – The name of the variable to plot.

  • dsname (str or None) – The name of the datastream to plot from.

  • x (str or None) – The name of the x coordinate variable.

  • y (str or None) – The name of the y coordinate variable.

  • subplot_index (tuple) – The index of the subplot to create the plot in.

  • sel_kwargs (dict) – The keyword arguments to pass into xarray.DataArray.sel() This is useful when your data is in 3 or more dimensions and you want to only view a cross section on a specific x-y plane. For more information on how to use xarray’s .sel and .isel functionality to slice datasets, see the documentation on xarray.DataArray.sel().

  • isel_kwargs (dict) – The keyword arguments to pass into xarray.DataArray.sel()

  • set_title (str) – Title for the plot

  • **kwargs (keyword arguments) – Additional keyword arguments will be passed into xarray.DataArray.plot().

Returns:

ax (matplotlib axis handle) – The matplotlib axis handle corresponding to the plot.