Am trying to get 3 images to be show side by side in matlab. But when I use subplot they are being spaced out unevenly. The first and second is a 25-by-25 pxl image and the third is a 25-by-75 image.
How can i get it to be show like
+-----++-----++---------------+
| img || img || img |
| 1 || 2 || 3 |
+-----++-----++---------------+
You can use subplot
to span multiple grid squares. For your example try
subplot(1,4,1)
subplot(1,4,2)
subplot(1,4,3:4) % this will expand the third axes over the last two grid squares
Note:
The position of the axes can be h=subplot(...)
returns the handle to the newly created axes. You can then use set
to adjust the axes or you can use
h=subplot('position', [left bottom width height])
manually place the axes in the figure. Also, note the functions get(h,'prop')
and set(h,'prop',value)
are also available to adjust other axes properties. See the MATHWORK's handle graphics browser section on axes for documentation on all the available properties.
Another alternative is to create a new image:
abuttedImage = [im1 im2 im3];
This will work as long as the number of rows in each image are the same.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With