Link to home
Create AccountLog in
Avatar of ty-exexch-ko
ty-exexch-koFlag for Albania

asked on

Display images side by side

How I can in Matlab using figure and imshow commands to display images side by side ?
Avatar of aaver
Flag of Afghanistan image

Have you tried using subplot?
I would do something like:

subplot(121), imshow(img1,[]);
subplot(122), imshow(img2,[]);
Avatar of ty-exexch-ko


Hi Kendor

small question
the number 121 inside subplot function refer for what ?

I try using numbers 1, 2 , 3 and etc. I get an error message
If I want to use subplot with 3 or 4 images to display side by side ?

I get an error message

I think available diferent way to use with figure and imshow
ok subplot functions as follows:

the first number tells you how many rows you have, the second number says how many columns and the third defines the overall position.

say you have 2 rows and 3 columns you would write:
subplot(2,3,x) and x would be the position like:
1 2 3
4 5 6

otherwise refer to:
Avatar of Kendor
Flag of Switzerland image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account