I'm trying to find a solution to plot a data series vs a date time variable set.
The initial format of the date time variable set was "01/01/2015 01:10:00", so I converted them to a better format to work with using datenum, like the following:
% Original Date Time Variable - Data.datetime.str(j,1:19)
Auxiliar.formatIn = 'dd/mm/yyyy HH:MM:SS';
for j = 1:length(Data.time)
Data.datetime.num(j,1) = datenum(Data.datetime.str(j,1:19), Auxiliar.formatIn);
end
After that, it was possible to plot everything using:
% Original Data Series - Data.anem1.max
plot(Data.datetime.num, Data.anem1.max)
labels = datestr(Data.datetime.num, 6);
set(gca, 'XTick', Data.datetime.num);
set(gca, 'XTickLabel', labels);
But the result is the one shown here:
.
The high density of labels on the x axis does not benefit me, since it's impossible to see anything and some points of the data series share the same day, for example.
How should I proceed to show the same day just once, limitting the the plot to a certain amount of labels?