0

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 is the code I am using for displaying the images:

for i = 1:50
    subplot(10,5,i);
    imshow(imread(fullfile('C:pathName',meanValues(i).baseFileName)));
end

Here's an example of how they look like:
enter image description here

Rotem
  • 30,366
  • 4
  • 32
  • 65
Niss
  • 23
  • 6
  • Here's the code i used to display them :for i = 1:50 subplot(10,5,i); imshow(imread(fullfile('C:pathName',meanValues(i).baseFileName))); end – Niss Apr 24 '21 at 17:57
  • Please click `edit` under your question and put all your code in there where people expect to find it... rather than forcing them to read through a load of unformatted comments. Thank you. – Mark Setchell Apr 24 '21 at 18:44
  • 1
    I think a good answer to this question is in [this SO thread:](https://stackoverflow.com/questions/5183047/setting-graph-figure-size) – Ravi Shankar Apr 24 '21 at 21:03
  • @Mark, Apologies. they've edited it before i do. – Niss Apr 25 '21 at 17:38

2 Answers2

0

I'm not sure but try

for i = 1:50
    t = subplot(10,5,i);
    imshow(imread(fullfile('C:pathName',meanValues(i).baseFileName)));
end
t.TileSpacing = 'compact'
t.Padding = 'compact'
Prabhat Mishra
  • 951
  • 2
  • 12
  • 33
  • i tried it but it gives me an error : Unrecognized property 'TileSpacing' for class 'matlab.graphics.axis.Axes'. Error in Exemple (line 223) t.TileSpacing = 'compact'; – Niss Apr 25 '21 at 18:00
0

try this

figure;
for x=1:5
  for y=1:10
    axes('position', [(x-1)*0.2, (y-1)*0.1, 0.2, 0.1] );
  end
end

if the layout works, insert the below two lines

    imshow(imread(fullfile('C:pathName',meanValues(y*5+x).baseFileName)));
    axis off;

below axes command above.

FangQ
  • 1,444
  • 10
  • 18
  • Hey @FangQ thank you for answering. i tired your suggestion but it didn't work (the images didn't appear at all) which is expected because in this case we're not calling the 50 images, in my code "i" represent the images. – Niss Apr 26 '21 at 18:45
  • the first block of code simply show you the layout of the axes, you have to insert the two lines of your imshow codes to the inner loop, under the axes command, to show your images. I converted my x/y indices to compute your i value. if it does not read your file, check the file indices. – FangQ Apr 27 '21 at 14:59