That's because datetick is a bit clunky, and it can't get a lock on a date that it thinks is worthy of displaying. Probably because your date range is somewhat short. For example, here's a year of data:
t = datenum(2005,1,1:365);
y = sind(t);
plot(t,y,'bo-')
datetick('x','DD/mm','keeplimits')
But if you only have 5 days of data it can't find a good match:
t = datenum(2005,1,1:5);
y = sind(t);
plot(t,y,'bo-')
datetick('x','DD/mm','keeplimits')
But you can specify xticks manually. Let's set an x tick every other day:
set(gca,'xtick',t(1:2:end))
datetick('x','DD/mm','keepticks','keeplimits')
Best Answer