How do i change the size of displayed images in a figure ?
5 views (last 30 days)
Show older comments
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.
0 Comments
Accepted Answer
DGM
on 24 Apr 2021
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 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!