I'm trying to fix a tricky issue with the axis on a plot I'm making in MATLAB. I want to display the dates and times of a temperature forecast (so the date labels plotted are essentially the hour the forecast is "valid" for, in 3-hour increments). The range of values is approximately 5 days, however my current plot is only showing the first five forecast times on the plot (instead the whole range, but only with a few points), as illustrated below:
I'm currently displaying these labels by creating a vector of strings containing the date labels (as generated from a matrix of DateVectors). The code for doing this is:
% Format all the dates into strings that can be displayed on the graph
for rid = 1:numRows
rowdate = formattedDates(rid,:); % DateVector for this forecast step
fcstDateStrs{rid} = datestr(rowdate, 'dd-mmm-yyyy HHZ');
end
Then, I place these dates as the y-axis with the line set(gca,'XtickLabel', {}, 'YtickLabel', fcstDateStrs)
. Is there a way I can scale the labels on that axis to show all of the date labels properly scaled (so that the first one was like "03-Oct-2012 06Z" and the last one would be something like "08-Oct-2012 06Z")?