how to display multiple image in one figure window

조회 수: 27 (최근 30일)
Shraddha Agnihotri
Shraddha Agnihotri 2014년 11월 23일
답변: Alexandra Holland 2022년 2월 16일
please tell me how show that dyanamic images to one plot...
  댓글 수: 1
Anjal Afghan
Anjal Afghan 2018년 7월 24일
you can do this:
if true
figure;
subplot(2,2,1),imshow(first_image);
subplot(2,2,2),imshow(second_image);
subplot(2,2,3),imshow(third_image);
subplot(2,2,4),imshow(fourth_image);
end
for a 4x4 plot

댓글을 달려면 로그인하십시오.

답변 (2개)

Geoff Hayes
Geoff Hayes 2014년 11월 23일
Shraddha - see subplot to create multiple axes on one figure/window, and see image for displaying an image to that axes.
For example, if you have four images and want to display each in its own axes, then you could do the following
% create the subplots
figure;
h = [];
h(1) = subplot(2,2,1);
h(2) = subplot(2,2,2);
h(3) = subplot(2,2,3);
h(4) = subplot(2,2,4);
Note that the h array contains the handles of the four axes (one for each subplot). Now if we have four images named img1, img2, img3, img4, then we display each as
image(img1,'Parent',h(1));
image(img2,'Parent',h(2));
image(img3,'Parent',h(3));
image(img4,'Parent',h(4));
Try the above and see what happens!
  댓글 수: 8
Parth Dethaliya
Parth Dethaliya 2020년 4월 10일
Hi I would like to what if the number of images are very high. suppose, 100 images.then?
Note: All images are of same size (25*25 pixels).
Walter Roberson
Walter Roberson 2020년 4월 10일
perhaps montage() would work for your circumstances.

댓글을 달려면 로그인하십시오.


Alexandra Holland
Alexandra Holland 2022년 2월 16일
This also happens to work for juxtaposition of imshow or histogram functions. I hope this helps!!
Overlay_adjG_TAG=labeloverlay(TAG_adjG, TAGmask,'Transparency',0.7,'Colormap','summer');
Overlay_adjG_VP1=imoverlay(VP1_adjG, VP1_mask_open, 'blue');
% 2x2 plot tile
tiledlayout(2,2)
nexttile
imshow(Overlay_log_DAPI) % image top left
nexttile
histogram(PearsonCoef,11); % image top right
nexttile
imshow(Overlay_adjG_TAG )% image bottom left
nexttile
imshow(Overlay_adjG_VP1) % image bottom right

카테고리

Help CenterFile Exchange에서 Red에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by