Stack plot or multiple y plot

조회 수: 6 (최근 30일)
Aaron
Aaron 2014년 4월 11일
편집: dpb 2014년 4월 11일
Hi,
I just wondering how to plot the curves in the image! Thanks.

답변 (1개)

dpb
dpb 2014년 4월 11일
편집: dpb 2014년 4월 11일
doc subplot
Adjust boundaries to fit the axes
ADDENDUM:
Sorry, didn't have time to demo before -- here's a rough cut start...
for i=1:3,hA(i)=subplot(3,1,i);end % create the 3 axes, save handles
p=cell2mat(get(hA,'position')); % get the positions
ptop=p(1,2)+p(1,4); % and compute to fit, adjust...
htavg=(ptop-p(3,2))/3
p(:,4)=htavg;
for i=2:-1:1,p(i,2)=p(i+1,2)+htavg;end
for i=1:3,set(hA(i),'position',p(i,:)),end
for i=1:3,set(hA(i),'box','on'),end
set(hA,'xlim',[1870 1990]) % now fiddle w/ axes limits, etc., ...
set(hA(1:2),'xtick',[])
for i=1:3,ylim(hA(i),[-3 4]),end
You'll likely want to use datenum and datetick for the x-axes--just remember need to set the limits the same for all three even though you're not showing them for the two.

카테고리

Help CenterFile Exchange에서 Title에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by