2017-04-07 39 views

回答

1

您所要做的就是使用SUBPLOT来绘制几个相互重叠的子图,并将x轴与linkaxes(h,'x')链接起来。示例代码:

numGraphs = 5; 
x = -20 + (20+20)*rand(numGraphs,30); 
figure; 
for i=1:numGraphs 
    h(i) = subplot(numGraphs,1,i); 
    plot(x(i,:)); 
    h(i).XAxisLocation = 'origin'; 
    box(h(i), 'off') 
end 
linkaxes(h,'x') 

将同步多图的X轴,你会碰到这样的:

enter image description here

+1

这肯定是要走的路! –

+0

谢谢乌萨马。 –