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!