0

I'm using MatLab for Image processing. I want to show images and histograms in 4 rows and and 2 columns but I fail to plot them

my code is below

% Show the images
subplot(1,2,1);imshow(I);
subplot(2,2,1);imshow(G);
subplot(3,2,1);imshow(B);
subplot(4,2,1);imshow(L);

% Plot Histograms
subplot(1,2,2);plot(h);
subplot(2,2,2);plot(hG);
subplot(3,2,2);plot(hB);
subplot(4,2,2);plot(hL);
it's me
  • 188
  • 1
  • 1
  • 10

1 Answers1

0

according to the MatLab Documentation subplot(totalNoOfRows,totalNoOfCols,Position);

Positions are

1 2

3 4

5 6

7 8

error free code is here

% Show the images
subplot(4,2,1);imshow(I);
subplot(4,2,3);imshow(G);
subplot(4,2,5);imshow(B);
subplot(4,2,7);imshow(L);

% Plot Histograms
subplot(4,2,2);plot(h);
subplot(4,2,4);plot(hG);
subplot(4,2,6);plot(hB);
subplot(4,2,8);plot(hL);
it's me
  • 188
  • 1
  • 1
  • 10
  • Please consult my post on [`subplot`](http://stackoverflow.com/questions/24337813/what-is-difference-between-subplot121-and-subplot1-2-1-in-matlab/24337903#24337903) to figure out how to use it in general. – rayryeng Jul 13 '14 at 19:52