How do i change the size of displayed images in a figure ?

조회 수: 4 (최근 30일)
nissrine Neyy
nissrine Neyy 2021년 4월 24일
답변: DGM 2021년 4월 24일
Hello,
I want to display a total of 50 (or 25) images in one figure, the thing that happens is they look small, how can i change their size please ?
here's an example of how they look.

채택된 답변

DGM
DGM 2021년 4월 24일
There's a couple things going on here. Not knowing what plot commands you're using, I'll just start with an example. I'm going to load 20 images and tile them using defaults. Nothing special here. I added a border so it's easier to see the image size against this white bg.
% load a bunch of face images into a cell array
facestack=mimread('sources/faces/BioID_15*.pgm');
m=4;
n=5;
for f=1:(m*n)
subplot(m,n,f)
imshow(facestack{f})
end
The default subplot padding is pretty huge. Instead of fiddling with geometries, I just tend to use this:
% load a bunch of face images into a cell array
facestack=mimread('sources/faces/BioID_15*.pgm');
m=4;
n=5;
for f=1:(m*n)
subplot_tight(m,n,f)
imshow(facestack{f})
end
Okay, so that's better, but what if I had paid no attention to the relationship between the aspect ratio of the figure and the aspect ratio of the axes?
% load a bunch of face images into a cell array
facestack=mimread('sources/faces/BioID_15*.pgm');
m=10;
n=2;
for f=1:(m*n)
subplot_tight(m,n,f)
imshow(facestack{f})
end
See what's going on here?

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by