how to make subplots with different heights?
21 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Image Analyst
2015-4-15
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Subplots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!