Plotting double vs datetime (DD-MM-YY), only the year is used from the datetime
Mostrar comentarios más antiguos
I am trying to plot datetime data (y axis) against double precision (x axis), but only the year is extracted from the datetime data. The two data files are attached.
Based on the matlab doc and six similar inquiries on this question, this should work, but there's evidently something I'm missing.
3 comentarios
Your mat files each contain over 100 variables and we have no idea which of them you are trying to plot.
Please post the code you are using to make the plot(s).
w = whos('-file', 'YEAR_1stIce.mat')
w = whos('-file', 'DATE_1stIce_CB.mat')
Walter Roberson
el 6 de Nov. de 2023
Please be more specific about your plotting command. There are a fair number of different variables in the files.
Paul Barrette
el 7 de Nov. de 2023
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 6 de Nov. de 2023
Speculating about what you are plotting:
If you
plot(SNOW_GP,DATE)
then your y axis has about 40 years. In order for it to be meaningful to display month as part of the output, you would need to have at least 80 yticks -- unless, that is, you wanted to do something like mark every 2 1/2 years.
You can use code such as
ax = gcal
ax.YRuler.TickLabelFormat = 'uuuu-mm';
1 comentario
Paul Barrette
el 7 de Nov. de 2023
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!