tfmri.plot.tiled_image_sequence
tfmri.plot.tiled_image_sequence¶
- tiled_image_sequence(images, part=None, cmap='gray', norm=None, fps=20.0, 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 image sequences in a grid.
- Parameters
images –
A 4D np.ndarray of shape
[batch, time, height, width]
(scalar values, mapped to colors usingcmap
) or a 5D np.ndarray of shape[batch, time, height, width, 3]
(RGB) or[batch, time, 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 ifimages
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.fps – A float. The number of frames per second. Defaults to 20.
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 –
- Returns
A matplotlib.animation.ArtistAnimation object.