How to make plot with date tick labels

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
Thank you so much in advance.

 採用された回答

jonas
jonas 2018 年 7 月 29 日

0 投票

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 件)

カテゴリ

ヘルプ センター および File ExchangeDates and Time についてさらに検索

質問済み:

2018 年 7 月 29 日

回答済み:

2018 年 7 月 29 日

Community Treasure Hunt

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

Start Hunting!

Translated by