Axis date values disappear when datetick is applied to a simple time-series plot
이전 댓글 표시
Hello,
I'm creating a plot of time (x-axis) against flow rate (y-axis). Time is displayed in decimal format and I want to convert this to real dates in the format dd/mm. To do this I am using datetick, which normally works for me, but the result in this instance is that all values on the x-axis are removed with the exception of the first and last values (which are converted to dd/mm format). Seems simple.
figure; plot(Time,flowrate,'r.'); datetick('x','dd/mm');
Any suggestions to what I might be doing wrong would be greatly appreciated.
채택된 답변
추가 답변 (1개)
Oleg Komarov
2011년 9월 7일
Get used to set the properties for your plots, especially when you start adding a little bit of customization. My plots sometimes take the whole screen and I am not doing anything special apart from setting labels, ticks and manually subplotting.
An example:
time = now-99:now;
flow = cumsum(randn(100,1));
plot(time,flow,'r')
datetick('x','dd/mm');
% Set Xlim and ticks position
set(gca, 'Xlim',time([1,end]),'Xtick',linspace(time(1),time(end),9))
댓글 수: 2
Saul
2011년 9월 7일
Oleg Komarov
2011년 9월 7일
Without the actual data is hard to guess what is happening. I would be interested to know what your times is.
카테고리
도움말 센터 및 File Exchange에서 Data Distribution Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!