Hi!
In this graph, I have plotted data for each day from 2015 to 2022. Is there a way to label the x axis with the month and year of plotting?

 Réponse acceptée

Cris LaPierre
Cris LaPierre le 28 Juin 2023

0 votes

Create a vector of x values that are datetimes. Then plot using plot(x,y) syntax.

3 commentaires

Indrani
Indrani le 29 Juin 2023
Following the approach that you mentioned I have got a graph which plots a single straight line for each date. However, the graph should be continuous, i.e. only the y-axis should be plotted and x-axis is for reference.
Cris LaPierre
Cris LaPierre le 29 Juin 2023
Share your code and your data. You can save your variables to a mat file and attach it to your post using the paperclip icon.
Indrani
Indrani le 29 Juin 2023
Thanks, but the issue has been solved!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by