필터 지우기
필터 지우기

How to set start date in line plot?

조회 수: 1 (최근 30일)
peterhack
peterhack 2016년 11월 12일
댓글: dpb 2016년 11월 13일
Hi,
I was wondering how to set the start date of the plot to be march for example.
t = datetime(2013,01,01):calmonths(1):datetime(2013,12,31);
[y,m,d] = ymd(t);
x = month(t,'shortname');
h = datetime(x,'Format','MMM');
z = rand(1,12);
plot(t,z,'DatetimeTickFormat','MMM')
Thanks!

채택된 답변

dpb
dpb 2016년 11월 12일
xl=xlim; % retrieve current limits
xlim([datetime(2013,03,01) xl(2)]) % set beginning x-limit to 3/1/2013, keep end as is
Salt to suit...
  댓글 수: 2
peterhack
peterhack 2016년 11월 12일
Any way to get rid of the single 2013 in the plot?
dpb
dpb 2016년 11월 13일
???? No idea what you mean?

댓글을 달려면 로그인하십시오.

추가 답변 (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