필터 지우기
필터 지우기

How to affix a horizontal subplot below a regular plot?

조회 수: 1 (최근 30일)
A R
A R 2021년 6월 27일
댓글: A R 2021년 6월 27일
Summary is it. I want to have a regular plot directly above a subplot (horizontal, about half the vertical size of the top plot).

채택된 답변

Image Analyst
Image Analyst 2021년 6월 27일
편집: Image Analyst 2021년 6월 27일
Do you mean like this:
subplot(3, 1, 1:2);
plot(rand(10, 1), 'b.-', 'LineWidth', 2);
grid on;
subplot(3, 1, 3);
plot(rand(10, 1), 'b.-', 'LineWidth', 2);
grid on;
Just use the top 2 plots in a 3x1 grid to do one plot, then the final last plot in the bottom row to do your other plot.
  댓글 수: 2
Image Analyst
Image Analyst 2021년 6월 27일
You can even combine different kinds of subplots, like:
% Plot in upper two lanes
subplot(3, 1, 1:2);
plot(rand(10, 1), 'b.-', 'LineWidth', 2);
grid on;
% Plot in lower left
subplot(3, 3, 7);
plot(rand(10, 1), 'b.-', 'LineWidth', 2);
grid on;
% Plot in lower right two panels.
subplot(3, 3, 8:9);
plot(rand(10, 1), 'b.-', 'LineWidth', 2);
grid on;
A R
A R 2021년 6월 27일
Thanks so much! The colon syntax never occurred to me.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Chunru
Chunru 2021년 6월 27일
subplot(3,1,1:2); plot(rand(10,1))
subplot(3,1,3); plot(rand(10,1));

카테고리

Help CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by