How to make plot with date tick labels

조회 수: 1 (최근 30일)
varunesh
varunesh 2018년 7월 29일
답변: jonas 2018년 7월 29일
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일
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개)

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by