필터 지우기
필터 지우기

Plotting against dates - datetick

조회 수: 3 (최근 30일)
Pankaj
Pankaj 2012년 1월 23일
I am plotting prices against dates using plot(date,price). date array is stored in the datenum form.
in order to read the dates along x-axis I use :
datetick('x','dd-mm-yy'); xlim([date(1,1) date(length(date),1)]); grid on;
there are two issues here: 1) i cannot tweak the interval on the date axis i.e. want to have labels every 3mths, 6 month or 2 weeks (as pref.)
2) i am not sure if i am handling dates and dateaxis in the best way. please suggest any alternatives.

답변 (2개)

owr
owr 2012년 1월 23일
Check out this MATLAB Central submission:
If it doesn't help you directly, you can learn a lot from editing and working through the code.

the cyclist
the cyclist 2012년 1월 23일
It can be a bit painful, but one solution is to adjust the tick spacing before you call datetick(), and then use the 'keepticks' option of datetick().

카테고리

Help CenterFile Exchange에서 Formatting and Annotation에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by