필터 지우기
필터 지우기

How do we change only the height of the subplots?

조회 수: 5 (최근 30일)
Anu
Anu 2022년 3월 3일
댓글: Image Analyst 2022년 3월 3일
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
Anu
Anu 2022년 3월 3일
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 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 CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by