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 Center および File ExchangeImages についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by