Display dates on x axis
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
CARLOTTA DENTICO
le 12 Juil 2021
Commenté : Cris LaPierre
le 12 Juil 2021
Hello everybody,
I wuold like to change time interval in the x axis every two years instead of every five years.
Thank you very muchbin advance
0 commentaires
Réponse acceptée
Cris LaPierre
le 12 Juil 2021
2 commentaires
Cris LaPierre
le 12 Juil 2021
We need to know what your x data looks like to give a solution specific to you. Is your x data already a datetime?
% spaced every 5 years
x = datetime(1990,1,1):years(1):datetime(2021,1,1);
y = rand(1,length(x));
plot(x,y)
% Use xticks to space every 2 years
figure
plot(x,y)
xticks(x(1):years(2):x(end))
xtickformat('yyyy')
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Dates and Time dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!