Matlab绘制子图subplot使用攻略
我们在sci论文的写作过程中通常遇到多个子图画在同一张图上,这篇文档将通过多个程序算例详细介绍Matlab绘制子图subplot使用攻略

2、例如:复制一下程序到matlab窗口figuret=0:0.001:1;y1=sin(10*t);y2=sin(15*t);y3=sin(20*t); y4=sin(25*t);subplot(2,2,1)plot(t,y1,'--r*','linewidth',2,'markersize',5)text(.5,.5,{'subplot(2,2,1)'},... 'FontSize',14,'HorizontalAlignment','center')subplot(2,2,2)plot(t,y2,'--b*','linewidth',2,'markersize',5)text(.5,.5,{'subplot(2,2,2)'},... 'FontSize',14,'HorizontalAlignment','center')subplot(2,2,3)plot(t,y2,'--b*','linewidth',2,'markersize',5)text(.5,.5,{'subplot(2,2,3)'},... 'FontSize',14,'HorizontalAlignment','center')subplot(2,2,4)plot(t,y2,'--r*','linewidth',2,'markersize',5)text(.5,.5,{'subplot(2,2,4)'},... 'FontSize',14,'HorizontalAlignment','center')程序编译结果如右图所示

2、例如:复制一下程序到matlab窗口figuret=0:0.001:1;y1=sin(10*t);y2=sin(15*t);y3=sin(20*t); y4=sin(25*t);subplot(2,2,[1 3])plot(t,y1,'--r*','linewidth',2,'markersize',5)subplot(2,2,2)plot(t,y2,'--b*','linewidth',2,'markersize',5)subplot(2,2,4)plot(t,y2,'--r*','linewidth',2,'markersize',5)程序编译结果如右图所示

4、例如:复制一下程序到matlab窗口figuret=0:0.001:1;y1=sin(10*t);y2=sin(15*t);y3=sin(20*t); y4=sin(25*t);subplot(2,2,[1 2])plot(t,y1,'--r*','linewidth',2,'markersize',5)subplot(2,2,3)plot(t,y2,'--b*','linewidth',2,'markersize',5)subplot(2,2,4)plot(t,y2,'--r*','linewidth',2,'markersize',5)程序编译结果如右图所示
