squidpy.im.ImageContainer.show

ImageContainer.show(layer=None, library_id=None, channel=None, channelwise=False, segmentation_layer=None, segmentation_alpha=0.75, transpose=None, ax=None, figsize=None, dpi=None, save=None, **kwargs)[source]

Show an image within this container.

Parameters:
  • layer (Optional[str]) – Image layer in img that should be processed. If None and only 1 layer is present, it will be selected.

  • library_id (Union[str, Sequence[str], None]) – Name of Z-dimension to plot. In None, plot all Z-dimensions as separate images.

  • channel (Union[int, Sequence[int], None]) – Channels to plot. If None, use all channels.

  • channelwise (bool) – Whether to plot each channel separately or not.

  • segmentation_layer (Optional[str]) – Segmentation layer to plot over each ax.

  • segmentation_alpha (float) – Alpha value for segmentation_layer.

  • transpose (Optional[bool]) – Whether to plot Z-dimensions in columns or in rows. If None, it will be set to not channelwise.

  • ax (Optional[Axes]) – Optional matplotlib axes where to plot the image. If not None, save, figsize and dpi have no effect.

  • figsize (Optional[tuple[float, float]]) – Size of the figure in inches.

  • dpi (Optional[int]) – Dots per inch.

  • save (Union[str, Path, None]) – Whether to save the plot.

  • kwargs (Any) – Keyword arguments for matplotlib.axes.Axes.imshow().

Return type:

None

Returns:

: Nothing, just plots the figure and optionally saves the plot.

Raises:

ValueError – If number of supplied axes is different than the number of requested Z-dimensions or channels.