plopp.plot#

plopp.plot(obj, *, aspect=None, cbar=True, coords=None, errorbars=True, figsize=None, grid=False, ignore_size=False, mask_color='black', norm='linear', scale=None, title=None, vmin=None, vmax=None, legend=True, **kwargs)[source]#

Plot a Scipp object.

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

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

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

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

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

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

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

  • ignore_size (bool, default: False) – If True, skip the check that prevents the rendering of very large data objects.

  • mask_color (str, default: 'black') – Color of masks in 1d plots.

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

  • scale (Optional[dict[str, str]], default: None) – Change axis scaling between log and linear. For example, specify scale={'tof': 'log'} if you want log-scale for the tof dimension.

  • title (Optional[str], default: None) – The figure title.

  • vmin (Union[Variable, float, None], default: None) – Lower bound for data to be displayed (y-axis for 1d plots, colorscale for 2d plots).

  • vmax (Union[Variable, float, None], default: None) – Upper bound for data to be displayed (y-axis for 1d plots, colorscale for 2d plots).

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

  • **kwargs

    All other kwargs are directly forwarded to Matplotlib, the underlying plotting library. The underlying functions called are the following:

    • 1d data with a non bin-edge coordinate: plot

    • 1d data with a bin-edge coordinate: step

    • 2d data: pcolormesh

Returns:

FigureLike – A figure.