Dateticks for hourly data
조회 수: 10 (최근 30일)
이전 댓글 표시
Hi,
I have hourly data for ten days. I have 235 values of a variable. I'm trying to plot it in 'dd/HH' format for x axis. Here is the sample code I wrote. But it gives me plenty of zeros in x axis which are not uncomprehensible.
% datetick example
clear all
clc
startdate=datenum('07-01-2011 00:00:00')
enddate=datenum('07-10-2011 18:00:00')
xdata=linspace(startdate,enddate,235);
val=1:235;
plot(xdata,val)
set(gca,'XTick',xdata);
datetick('x','dd/HH','keepticks')
Thanks in advance,
Aishwarya.
댓글 수: 0
답변 (1개)
the cyclist
2012년 4월 20일
You are setting the tick marks to be at every single value of your xdata. 235 ticks marks! Then you are specifically telling the datetick command to keep those ticks. I suggest you change one of those two commands.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!