How do we change only the height of the subplots?
4 次查看(过去 30 天)
显示 更早的评论
I want to increase the height of the subplots in a figure. I checked many MATLAB answers, but unfortunately, nothing is working out perfectly. Recently, I have started commenting on one of the same questions asked (https://uk.mathworks.com/matlabcentral/answers/779797-how-to-change-the-height-of-the-subplots-without-changing-x-y-positions-and-width). I am posting this as a question to get more visibility.
I have also used the suggestion given in 1. https://uk.mathworks.com/matlabcentral/answers/1580549-increase-the-height-size-of-subplots 2. https://uk.mathworks.com/matlabcentral/answers/47713-how-to-increase-figure-window-height
I have seven subplots that I am arranging in four columns and two rows. Here, just for simplicity, I have shown two subplots. Any suggestion would really be helpful to increase the height of each subplot, And how to fix the bottom of the whole figure, which is almost empty. Thanks in advance.
lowerlimit= 0;
upperlimit=300;
interval= 20;
figure()
ax(1)=subplot(4, 4, 1);
h1 = bar(1, ysp1_1, 'b');
hold on
h2 = bar(2, ysp1_3, 'r');
hold on
h3 = bar(3, ysp1_5, 'k');
hold on
h4 = bar(4, ysp1_7, 'g');
hold on
h5 = bar(5, ysp1_9, 'm');
set(ax(1),'xtick',[])
hold off
axis padded
grid;
set(gca, 'ytick', lowerlimit:interval:upperlimit);
ylabel('f0 (Hz)');
title('S1\_F')
ax(2)=subplot(4, 4, 2);
h1 = bar(1, ysp2_1, 'b');
hold on
h2 = bar(2, ysp2_3, 'r');
hold on
h3 = bar(3, ysp2_5, 'k');
hold on
h4 = bar(4, ysp2_7, 'g');
hold on
h5 = bar(5, ysp2_9, 'm');
set(ax(2),'xtick',[])
hold off
axis padded
grid;
set(gca, 'ytick', lowerlimit:interval:upperlimit);
ylabel('f0 (Hz)');
title('S2\_F')
3 个评论
Image Analyst
2022-3-3
If @Simon Chan puts the answer down in the official "Answers" section, you can accept it and award him two "reputation points".
回答(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!