Function File: montage (I)
Function File: montage (X, cmap)
Function File: montage (filenames)
Function File: montage (…, param1, value1, …)
Function File: h = montage (…)

Create montage from multiple images.

The created montage will be of a single large image built from the 4D matrix I. I must be a MxNx1xP or MxNx3xP matrix for a grayscale and binary, or RGB image with P frames.

Alternatively, X can be a MxNx1xP indexed image with P frames, with the colormap cmap, or a cell array of filenames for multiple images.

DisplayRange

A vector with 2 or 0 elements setting the highest and lowest value for display range. It is interpreted like the limits argument to imshow. Of special significance is that an empty array uses the image minimum and maximum values for limits. Defaults to the limits of the image data type, i.e., the range returned by getrangefromclass.

Indices

A vector with the image indices to be displayed. Defaults to all images, i.e., 1:size (I, 4).

Size

Sets the montage layout size. Must be a 2 element vector setting [nRows nCols]. A value of NaN will be adjusted to the required value to display all images. If both values are NaN (default), it will find the most square layout capable of displaying all of the images.

MarginColor

Sets color for the margins between panels. Defaults to white. Must be a 1 or 3 element vector for grayscale or RGB images.

MarginWidth

Sets width for the margins between panels. Defaults to 0 pixels. Note that the margins are only between panels.

BackgroundColor

Sets the montage background color. Defaults to black. Must be a 1 or 3 element vector for grayscale or RGB images. This will only affect montages with more panels than images.

The optional return value H is a graphics handle to the created plot.

See also: imshow, padarray, permute, reshape.

Package: image