フィルターのクリア

Merge all figures into one plot

5 ビュー (過去 30 日間)
David E.S.
David E.S. 2021 年 11 月 6 日
編集済み: Dave B 2021 年 11 月 7 日
Using the following code:
f1 = figure;
plot(rand(10),rand(10),'-');
f2 = figure;
plot(rand(10),rand(10),'-');
f3 = figure;
plot(rand(10),rand(10),'-');
f4 = figure;
plot(rand(10),rand(10),'-');
f5 = figure;
plot(rand(10),rand(10),'-');
I want to know if there is any alternative to subplot in order to merge all of the five figures created above and then, increase the height of the combined plot reducing the space between figures (if I use a subplot, each one of the figures are too narrow).
  1 件のコメント
Star Strider
Star Strider 2021 年 11 月 6 日
It appears that you independently discovered the approach I would have suggested: Increase the height (size) of subplots

サインインしてコメントする。

回答 (1 件)

Dave B
Dave B 2021 年 11 月 7 日
編集済み: Dave B 2021 年 11 月 7 日
tiledlayout and nexttile is a good alternative to subplot and gives you a little more control over the spacing between plots. Its first release was 2019b, so the options have gotten a little bit more sophisticated since then, but it still had more alternatives than subplot. TileSpacing let's you control the space inside (between the axes) and Padding lets you control the space outside of the axes.
figure
t=tiledlayout(2,2,'TileSpacing','compact');
for i = 1:4
nexttile;
end
figure
t=tiledlayout(2,2,'TileSpacing','loose');
for i = 1:4
nexttile;
end
figure
t=tiledlayout(2,2,'TileSpacing','tight'); % or none? one of these options was added after 2019b, I forget which one
for i = 1:4
nexttile;
end

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by