How to split x-axis (6 years of timeseries) with datetick into monthly intervals?
1 回表示 (過去 30 日間)
古いコメントを表示
Hello,
I've got my time series data of 6 years plus and I would like to plot them in that way so that in the x-axis I would have the year and the month.
I tried the code below, but it gives me strange result, for example some months are skipped, the spacing does not seem to be equal sized.
What do you think I could do?
Thanks a lot!
%%
startdate = datenum('20-Oct-2002 15:00:00');
enddate = datenum('28-Dec-2008 11:00:00');
t = linspace (startdate,enddate,54261); %54261 is the length of my dataset
figure
plot(t,Rain)
grid on
NumTicks = 72;
L = get(gca,'XLim');
set(gca,'XTick',linspace(L(1),L(2),NumTicks))
datetick('x','mmm yyyy', 'keepticks')
set(gca,'XMinorTick','on') %,'YMinorTick','on')
rotateticklabel(gca, 90);
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!