plopp.slicer#

plopp.slicer(obj, keep=None, *, aspect=None, autoscale=True, cbar=True, clabel=None, cmap='viridis', cmax=None, cmin=None, coords=None, enable_player=False, errorbars=True, figsize=None, grid=False, legend=True, logc=None, logx=None, logy=None, mask_cmap='gray', mask_color=None, nan_color=None, norm=None, scale=None, title=None, vmax=None, vmin=None, xlabel=None, xmax=None, xmin=None, ylabel=None, ymax=None, ymin=None, **kwargs)[source]#

Plot a multi-dimensional object by slicing one or more of the dimensions. This will produce one slider per sliced dimension, below the figure.

Parameters:
  • obj (Variable | DataArray | Dataset | DataGroup[Any] | ndarray | Node | dict[str, Variable | DataArray | Dataset | DataGroup[Any] | ndarray | Node]) – The object to be plotted.

  • keep (list[str] | None, default: None) – The single dimension to be kept, all remaining dimensions will be sliced. This should be a single string. If no dim is provided, the last/inner dim will be kept.

  • aspect (Literal['auto', 'equal', None], default: None) – Aspect ratio for the axes.

  • autoscale (bool, default: True) – Automatically scale the axes/colormap on updates if True.

  • cbar (bool, default: True) – Show colorbar in 2d plots if True.

  • clabel (str | None, default: None) – Label for colorscale (2d plots only).

  • cmap (str, default: 'viridis') – The colormap to be used for the colorscale (2d plots only).

  • cmax (Variable | float | None, default: None) – Upper limit for colorscale (2d plots only).

  • cmin (Variable | float | None, default: None) – Lower limit for colorscale (2d plots only).

  • coords (list[str] | None, default: None) – If supplied, use these coords instead of the input’s dimension coordinates.

  • enable_player (bool, default: False) – If True, add a play button to the sliders to automatically step through the slices.

  • errorbars (bool, default: True) – Show errorbars in 1d plots if True.

  • figsize (tuple[float, float] | None, default: None) – The width and height of the figure, in inches.

  • grid (bool, default: False) – Show grid if True.

  • legend (bool | tuple[float, float], default: True) – Show legend if True. If legend is a tuple, it should contain the (x, y) coordinates of the legend’s anchor point in axes coordinates.

  • logc (bool | None, default: None) – If True, use logarithmic scale for colorscale (2d plots only).

  • logx (bool | None, default: None) – If True, use logarithmic scale for x-axis.

  • logy (bool | None, default: None) – If True, use logarithmic scale for y-axis.

  • mask_cmap (str, default: 'gray') – Colormap to use for masks in 2d plots.

  • mask_color (str | None, default: None) – Color of masks.

  • nan_color (str | None, default: None) – Color to use for NaN values in 2d plots.

  • norm (Literal['linear', 'log', None], default: None) – Set to 'log' for a logarithmic y-axis (1d plots) or logarithmic colorscale (2d plots). Legacy, prefer logy and logc instead.

  • scale (dict[str, str] | None, default: None) – Change axis scaling between log and linear. For example, specify scale={'time': 'log'} if you want log-scale for the time dimension. Legacy, prefer logx and logy instead.

  • title (str | None, default: None) – The figure title.

  • vmax (Variable | float | None, default: None) – Upper limit for data to be displayed (y-axis for 1d plots, colorscale for 2d plots). Legacy, prefer ymax and cmax instead.

  • vmin (Variable | float | None, default: None) – Lower limit for data to be displayed (y-axis for 1d plots, colorscale for 2d plots). Legacy, prefer ymin and cmin instead.

  • xlabel (str | None, default: None) – Label for x-axis.

  • xmax (Variable | float | None, default: None) – Upper limit for x-axis.

  • xmin (Variable | float | None, default: None) – Lower limit for x-axis.

  • ylabel (str | None, default: None) – Label for y-axis.

  • ymax (Variable | float | None, default: None) – Upper limit for y-axis.

  • ymin (Variable | float | None, default: None) – Lower limit for y-axis.

  • **kwargs – Additional arguments forwarded to the underlying plotting library.

Return type:

FigureLike