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, mask_cmap='gray', mask_color='black', mode='point', nan_color=None, norm=None, operation='sum', orientation='horizontal', title=None, vmax=None, vmin=None, xlabel=None, xmax=None, xmin=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. In mode='point' it allows placing point markers on the image to slice at that position, retaining only the third dimension and displaying the resulting one-dimensional slice in the right-hand side figure. In mode='polygon' it allows drawing a polygon to compute the total intensity inside the polygon as a function of the third dimension.

Controls (point mode): - Left-click to make new points - Left-click and hold on point to move point - Middle-click to delete point

Controls (polygon mode): - Left-click to make new polygons - Left-click and hold on polygon vertex to move vertex - Right-click and hold to drag/move the entire polygon - Middle-click to delete polygon

Notes

Almost all the arguments for plot customization apply to the two-dimensional image (unless specified).

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 (Optional[Literal['auto', 'equal']], 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.

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

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

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

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

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

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

  • mode (Literal['point', 'polygon'], default: 'point') – Select 'point' for point inspection or 'polygon' for polygon selection with total intensity inside the polygon plotted as a function of dim.

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

  • norm (Optional[Literal['linear', 'log']], default: None) – Set to 'log' for a logarithmic colorscale. Legacy, prefer 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 colorscale to be displayed. Legacy, prefer cmax instead.

  • vmin (Variable | float | None, default: None) – Lower limit for data colorscale to be displayed. Legacy, prefer cmin instead.

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

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

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

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

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