필터 지우기
필터 지우기

how to tick out yearly?

조회 수: 3 (최근 30일)
davit petraasya
davit petraasya 2016년 5월 6일
댓글: davit petraasya 2016년 5월 6일
Hi
Does anyone knows how to tick out yearly? I am using set(gca,'TickDir','out'); it is working but my ticks is appearing in every 10 years. I need ticks out yearly.
So how do I tick out yearly?
Thanks!

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2016년 5월 6일
Look at this example
d=datenum('01-01-2015'):datenum('01-01-2035');
y=log(d);
plot(d,y)
a=datevec(d);
[ii,jj]=unique(a(:,1));
set(gca,'xtick',d(jj))
datetick('x','yyyy','keepticks')
  댓글 수: 7
Azzi Abdelmalek
Azzi Abdelmalek 2016년 5월 6일
add to previous code
set(gca,'TickDir','out')
davit petraasya
davit petraasya 2016년 5월 6일
Okay,great. Thanks Azzi.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Grid Lines, Tick Values, and Labels에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by