How to split x-axis (6 years of timeseries) with datetick into monthly intervals?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Annotations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!