title for displaying multiple images using montage function

97 ビュー (過去 30 日間)
Kiruthiga Sekar
Kiruthiga Sekar 2021 年 1 月 6 日
コメント済み: kotchakon 2023 年 3 月 5 日
Hi,
Is it possible to add title to four images that are displayed using montage? Or is there any other similar function which can be used to display multiple images along with title? Thanks in advance

回答 (1 件)

Adam Danz
Adam Danz 2021 年 1 月 6 日
> Is it possible to add title to four images that are displayed using montage?
No. Image data are combined into a single image on a single axis when using montag() or imtile(). You can add a single title using the title() function. You can use the text() function to add what appears to be titles to each tiled sub-image but you'll need to compute the upper-center of each sub-image to place the titles in the right place and the title text will be plotted on top of the sub-images.
> is there any other similar function which can be used to display multiple images along with title?
A single function, no. But you can plot each image within their own axes using subplot, TiledLayout, or with axex() to create the axes and imshow to plot the images.
Demo using TiledLayout:
img{1} = imread('AT3_1m4_01.tif'); % built-in images
img{2} = imread('AT3_1m4_02.tif');
img{3} = imread('AT3_1m4_03.tif');
img{4} = imread('AT3_1m4_04.tif');
fig = figure();
tlo = tiledlayout(fig,2,2,'TileSpacing','None');
for i = 1:numel(img)
ax = nexttile(tlo);
imshow(img{i},'Parent',ax)
title(['Image ', num2str(i)])
end
  1 件のコメント
kotchakon
kotchakon 2023 年 3 月 5 日
Great job! Now, I can title mutiple image. So easy! Thanks

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeScripts についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by