montage
Display multiple image frames as rectangular montage
Syntax
Description
montage(
displays all frames of a
multiframe image array I
)I
. By default, the
montage
function arranges the images so that they roughly
form a square.
montage(
displays a montage of
images specified in the cell array imagelist
)imagelist
. The images can be
of different types and sizes.
montage(___,
treats all
grayscale and binary images (specified using any of the preceding syntaxes) as
indexed images and displays them with the specified colormap
map
)map
. If you specify images using file names or an image
datastore, then map
overrides any internal colormap present in
the image files. montage
does not modify the colormap of RGB
images.
montage(___,
uses
name-value pair arguments to customize the display of the image montage.Name,Value
)
returns a
handle to the single image object that contains all the frames displayed.img
= montage(___)
Note
Medical Imaging Toolbox™ extends the functionality of the montage
(Image Processing Toolbox™) function to display data from a medicalImage
(Medical Imaging Toolbox) or medicalVolume
(Medical Imaging Toolbox) object. For more information, see montage
(Medical Imaging Toolbox).
Examples
Input Arguments
Output Arguments
Tips
If you specify an indexed image, then
montage
converts it to RGB using the colormap present in the file.If there is a data type mismatch between images, then the
montage
function converts all images to data typedouble
using theim2double
function.When calculating the number of images to display horizontally and vertically,
montage
considers the aspect ratio of the images, so that the displayed montage is nearly square.Figure titles can appear cut off in the Live Editor. To ensure the whole title is visible, set the
PositionContraint
property of the parent axes object to"outerposition"
. Update the property value after themontage
function and before thetitle
function.If you specify the parent axes using theI = imread("peppers.png"); montage({I,I}) ax = gca; ax.PositionConstraint = "outerposition"; title("Peppers");
Parent
name-value argument, set thePositionConstraint
property of the specified parent axes object. For more details about axes position properties, see Control Axes Layout.
Version History
Introduced before R2006a