plotting all the years of a time period vertically to the x-axis
Ältere Kommentare anzeigen
Dear all,
I have ns=2838 daily observations y. I plot these data using the following commands
startDate = datenum('07-01-1996');
endDate = datenum('07-30-2007');
xData = linspace(startDate,endDate,ns);
figure
plot(xData, y )
datetick( 'x','yyyy','keepticks' )
In this case, I obtain the following sequence of years on the x-axis:
1995, 19997, 1998,2000,2001,2002,2004, 2005, 2006, 2008
But I would like to have, vertically to the x-axis, all the years starting from 01/1996 till 30/2007, that is
01/1996, 01/1997, 01/1998 , 01/1999 01/2000 , 01/2001, 01/2002 ...
How could I modify the above code to do that?
Thanks in advance
Akzeptierte Antwort
Weitere Antworten (1)
Azzi Abdelmalek
am 29 Aug. 2013
0 Stimmen
3 Kommentare
antonet
am 29 Aug. 2013
Azzi Abdelmalek
am 29 Aug. 2013
Give a short example with data
antonet
am 29 Aug. 2013
Kategorien
Mehr zu Dates and Time finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!