How to make plot with date tick labels
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
varunesh
el 29 de Jul. de 2018
Respondida: jonas
el 29 de Jul. de 2018
Hello,
I have monthly time series data 1901:2005 (1*1260). I want to put months with years on xtick like the attached example figure. Please help me. I am also uploading my data in mat format
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/192782/image.png)
Thank you so much in advance.
0 comentarios
Respuesta aceptada
jonas
el 29 de Jul. de 2018
Very easy if you use the datetime format.
data=load('data.mat');
t=datetime(1901,1:1260,1)
plot(t,data.deseasoned_data)
xtickformat('MMM yyyy')
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Dates and Time en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!