plot multiple time plots
이전 댓글 표시
I want to plot multiple channels of data, all against time, with one channel per plot. Possibly in more than one column if there are two many columns. Also, would like to zoom on all plots in the x axis at once. I would like the plots to be touching vertically, with x tick marks on all plots.
tSec=0:0.01:20;
nt = length(tSec);
ny = 5;
y=rand(nt,ny);
tJulian = tSec/(60*60*24) + datenum('2016-11-06 10:00');
figure;
for iy=1:ny
subplot(ny,1,iy);
plot(tJulian ,y(:,iy),'k.','markersize',2)
datetick('x','MM:SS');
if (iy~=ny)
set(gca,'xticklabel',[]);
else
xlabel('Time');
end
end
댓글 수: 1
doc linkaxes
will help with having all plots zoom together. You can specify with axis you want to be linked e.g.
linkaxes( hAxes, 'x' )
to only link the x axes of multiple axes.
To get axes where you want them you'll likely have to create them programmatically, removing ticks and things you don't want from all but e.g. the left-most plot. Subplot tends to leave a lot of blank space around plots which is not always desirable so creating your own axes and positioning them so they are right next to each other gives you greater flexibility.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Data Exploration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!