plopp.inspector#

plopp.inspector(obj, dim=None, *, aspect=None, autoscale=True, cbar=True, clabel=None, cmax=None, cmin=None, errorbars=True, figsize=None, grid=False, legend=True, logc=None, logy=None, mask_cmap='gray', mask_color='black', nan_color=None, norm=None, operation='sum', orientation='horizontal', title=None, vmax=None, vmin=None, xlabel=None, ylabel=None, ymax=None, ymin=None, **kwargs)[source]#

Inspector takes in a three-dimensional input and applies a reduction operation ('sum' by default) along one of the dimensions specified by dim. It displays the result as a two-dimensional image. In addition, an ‘inspection’ tool is available in the toolbar which allows to place markers on the image which perform slicing at that position to retain only the third dimension and displays the resulting one-dimensional slice on the right hand side figure.

Controls: - Click to make new point - Drag existing point to move it - Middle-click to delete point

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

  • dim (str | None, default: None) – The dimension along which to apply the reduction operation. This will also be the dimension that remains in the one-dimensional slices generated by adding markers on the image. If no dim is provided, the last (inner) dim of the input data will be used.

  • 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 if True (2d figure).

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

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

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

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

  • 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 (1d figure).

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

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

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

  • mask_color (str, default: 'black') – Color of masks (overrides mask_cmap).

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

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

  • operation (Literal['sum', 'mean', 'min', 'max'], default: 'sum') – The operation to apply along the third (undisplayed) dimension specified by dim.

  • orientation (Literal['horizontal', 'vertical'], default: 'horizontal') – Display the two panels side-by-side (‘horizontal’) or one below the other (‘vertical’).

  • 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 figure, colorscale for 2d figure). Legacy, prefer ymax and cmax instead.

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

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

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

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

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

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

Returns:

A Box which will contain two Figure and one slider widget.