act.plotting.XSectionDisplay.plot_xsection

XSectionDisplay.plot_xsection(dsname, varname, x=None, y=None, subplot_index=(0,), sel_kwargs=None, isel_kwargs=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:
  • dsname (str or None) – The name of the datastream to plot from. Set to None to have ACT attempt to automatically detect this.

  • varname (str) – The name of the variable to plot.

  • 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()

  • **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.