Thursday, January 20, 2011

Matlab-4 Display multiple images, plots in a single window in MATLAB

How to display multiple images or graphs in a single window (frame) in MATLAB


This is done by using the subplot command in MATLAB

Suppose we have to display 4 images (aa,bb,cc,dd) in a single figure and arrange them in 2x2 fashion.

We will use the following commands:

figure;

subplot(2,2,1);imshow(aa);
subplot(2,2,2);imshow(bb);
subplot(2,2,3);imshow(cc);
subplot(2,2,4);imshow(dd);


similary to display two image in 2x1 fashion, we will use:

subplot(2,1,1);imshow(aa);
subplot(2,1,2);imshow(bb);

3 comments:

  1. nice Info you shared here thanks for sharing this here ...... can you let me know from ware I can buy a Brand New Battery with three Months Warranty for my laptop

    ReplyDelete
  2. dude big help thanks

    ReplyDelete
  3. very much useful for beginners. Thanks a lot.
    Can you please inform me , how can i write figure caption below each image in the multiple display.

    ReplyDelete