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")

网友评论