Subdivide a figure window into two rows and one column?

18 ビュー (過去 30 日間)
Antonio
Antonio 2025 年 1 月 27 日 0:55
回答済み: 埃博拉酱 2025 年 1 月 27 日 1:13
I am trying to use the subplot command for class and I'm not sure if the plot is displaying properly based on the code I am writing.
% 1) Subdivide a figure window into two rows and one column.
subplot(5,4,2)

回答 (1 件)

埃博拉酱
埃博拉酱 2025 年 1 月 27 日 1:13
According to documentation, subplot is not recommended and you'd better use tiledlayout for new projects:
tiledlayout(2,1);
nexttile(1);
%Plot code in tile 1;
nexttile(2);
%Plot code in tile 2
Or if you must use subplot:
subplot(2,1,1);
%Plot code in tile 1;
subplot(2,1,2);
%Plot code in tile 2

カテゴリ

Help Center および File ExchangeSubplots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by