tfmri.plot.tiled_image

tiled_image(images, part=None, cmap='gray', norm=None, fig_size=None, dpi=None, bg_color='dimgray', layout=None, bbox_inches=None, pad_inches=0.1, aspect=1.77, grid_shape=None, fig_title=None, subplot_titles=None)[source]

Plots one or more images in a grid.

Parameters
  • images

    A 3D np.ndarray of shape [batch, height, width] (scalar values, mapped to colors using cmap) or a 4D np.ndarray of shape [batch, height, width, 3] (RGB) or [batch, height, width, 4] (RGBA).

  • part – An optional str. The part to display for complex numbers. One of 'abs', 'angle', 'real' or 'imag'. Must be specified if images has complex dtype.

  • cmap

    A str or matplotlib.colors.Colormap. The colormap used to map scalar values to colors. This parameter is ignored for RGB(A) data. Defaults to 'gray'.

  • norm – A matplotlib.colors.Normalize. Used to scale scalar data to the [0, 1] range before mapping to colors using cmap. By default, a linear scaling mapping the lowest value to 0 and the highest to 1 is used. This parameter is ignored for RGB(A) data.

  • fig_size – A tuple of floats. Width and height of the figure in inches.

  • dpi

    A float. The resolution of the figure in dots per inch.

  • bg_color – A color. The background color.

  • layout

    A str. One of None, 'tight' (default) or 'constrained'. The layout mechanism. See matplotlib.figure.Figure for details.

  • bbox_inches

    A str or matplotlib.transforms.Bbox. Bounding box in inches: only the given portion of the figure is displayed. If 'tight', try to figure out the tight bbox of the figure.

  • pad_inches

    A float. Amount of padding around the figure when bbox_inches is 'tight'. Defaults to 0.1.

  • aspect

    A float. The desired aspect ratio of the overall figure. Ignored if grid_shape is specified.

  • grid_shape

    A tuple of floats. The number of rows and columns in the grid. If None, the grid shape is computed from aspect.

  • fig_title

    A str. The title of the figure.

  • subplot_titles

    A list of strs. The titles of the subplots.

Returns

A list of matplotlib.image.AxesImage objects.