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.
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 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!