fishtank.pl.imshow

Contents

fishtank.pl.imshow#

fishtank.pl.imshow(X, colors=None, norm='linear', vmin=None, vmax=None, aspect=None, origin='lower', extent=None, ax=None, **kwargs)#

Display image with specified colors

Parameters:
  • X (ndarray) – a (C,Y,X) image array representing a multi-channel image.

  • colors (Union[list, str, None] (default: None)) – a list of colors to use for each channel. Default is [“magenta”, “green”, “blue”,”yellow”,”cyan”,”red”].

  • norm (str (default: 'linear')) – the normalization method used to scale scalar data to the [0, 1] range before mapping to colors using cmap. By default, a linear scaling is used, mapping the lowest value to 0 and the highest to 1.

  • vmin (Union[int, str, None] (default: None)) – the minimum value of the color scale. Can be a single value of a list of values, one for each channel. Strings with format “p05” are interpreted as percentiles.

  • vmax (Union[int, str, None] (default: None)) – the maximum value of the color scale. Can be a single value of a list of values, one for each channel. Strings with format “p95” are interpreted as percentiles.

  • aspect (Union[str, float, None] (default: None)) – the aspect ratio of the image. By default, this is set to “equal”.

  • origin (str (default: 'lower')) – place [0,0] index of the array in the upper left or lower left corner of the Axes.

  • extent (Optional[tuple] (default: None)) – [left, right, bottom, top] the bounding box in data coordinates that the image will fill. These values may be unitful and match the units of the Axes. The image is stretched individually along x and y to fill the box.

  • ax (Optional[Axes] (default: None)) – a matplotlib Axes object to plot the image on. If None, the current Axes will be used.

  • kwargs – additional keyword arguments passed to the matplotlib imshow function.

Return type:

AxesImage

Returns:

ax the matplotlib Axes object used to plot the image.