tiledlayout 或 subplot

2022-09-17  本文已影响0人  思求彼得赵

2022-09-17

您可以使用 tiledlayout 或 subplot 在同一窗口的不同部分显示多个绘图。

tiledlayout 函数是在 R2019b 中引入的,该函数比 subplot 提供更多对标签和间距的控制。例如,在图窗窗口中创建 2×2 布局。然后,每当您要某个绘图出现在下一区域中时,请调用 nexttile。

t = tiledlayout(2,2);
title(t,"Trigonometric Functions")
x = linspace(0,30);

nexttile
plot(x,sin(x))
title("Sine")

nexttile
plot(x,cos(x))
title("Cosine")

nexttile
plot(x,tan(x))
title("Tangent")

nexttile
plot(x,sec(x))
title("Secant")
image.png
上一篇 下一篇

猜你喜欢

热点阅读