在一张图上画多幅数据图

类田字格排布

x=(0:0.01:2*pi);
y1=sin(x);
subplot(2,2,1); %
plot(x,y1);
y2=cos(x);
subplot(2,2,2);
plot(x,y2);
y3=tan(x);
subplot(2,2,3);
plot(x,y3);
y4=cot(x);
subplot(2,2,4);
plot(x,y4)

重叠排布.

方法一

x=(0:0.01:2pi);

plot(x,sin(x),x,sin(2x),x,sin(3x),x,sin(4x))

方法二

x=(0:0.01:2pi); y1=sin(x); plot(x,y1); hold on; y2=sin(2x);
plot(x,y2);
hold on;
y3=sin(3x); plot(x,y3); hold on; y4=sin(4x);
plot(x,y4)
set(gca, ‘LooseInset’, [0,0,0,0]) %去除掉坐标轴旁边的空隙