How to change my x axis value
32 views (last 30 days)
Nurul Ain Basirah Zakaria on 14 Jan 2021
Hello. Is it possible for me to change my x axis value? My data is from 1982-2017. I plot and came out like this:
but I want it to be like this:
The x-axis showing the year.
Thank you in advance!
the cyclist on 14 Jan 2021
Edited: the cyclist on 14 Jan 2021
It would be helpful if you posted your data, so we know exactly how it is stored (e.g. do you just have the years stored as numeric values, or do you have whole dates stored as datetime type?).
But, it looks like you did
which will default to plotting x = 1:N, where N is the number of data points in y.
Instead, you should