Borrar filtros
Borrar filtros

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

5 visualizaciones (últimos 30 días)
nissrine Neyy
nissrine Neyy el 24 de Abr. de 2021
Respondida: DGM el 24 de Abr. de 2021
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.

Respuesta aceptada

DGM
DGM el 24 de Abr. de 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?

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by