x axis label in plot

1 view (last 30 days)
Indrani
Indrani on 28 Jun 2023
Commented: Indrani on 29 Jun 2023
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?

Accepted Answer

Cris LaPierre
Cris LaPierre on 28 Jun 2023
Create a vector of x values that are datetimes. Then plot using plot(x,y) syntax.
  3 Comments
Cris LaPierre
Cris LaPierre on 29 Jun 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 on 29 Jun 2023
Thanks, but the issue has been solved!

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!