How do we change only the height of the subplots?

4 views (last 30 days)
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 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 Comments
Anu
Anu on 3 Mar 2022
Thanks so much.. @Simon Chan Now I understand why there was an empty space in the bottom of the figure :-). It solves the issue.
Image Analyst
Image Analyst on 3 Mar 2022
If @Simon Chan puts the answer down in the official "Answers" section, you can accept it and award him two "reputation points".

Sign in to comment.

Answers (0)

Categories

Find more on Line Plots 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!