how to make subplots with different heights?
21 views (last 30 days)
Show older comments
I would like to plots below each other, but the first one is a picture with small height. I dont want large empty space. How to set the height of the first
subplot? Or automatically adjust it?
subplot(2,1,1)
imagesc(mypicture)
subplot(2,1,2)
plot(randn(100,1))
0 Comments
Answers (1)
Image Analyst
on 15 Apr 2015
Set the 'OuterPosition' property of the axes control that subplot creates
h1 = subplot(2,1,1);
set(h1, 'OuterPosition', [0,0.51, 1, .4]);
mypicture = imread('cameraman.tif');
imagesc(mypicture)
h2 = subplot(2,1,2);
set(h2, 'OuterPosition', [0,0, 1, .4]);
plot(randn(100,1))
Take great care with the position values because if the second axes overlaps the first one at all, none of the first one will show up.
0 Comments
See Also
Categories
Find more on Subplots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!