Plotting multiple days on one graph
Show older comments
So normally, I would do something like this:
yValue = [1 2 3 4 5];
time = [8.5 10 10.20 13.4 15.2]; %(8.5 = 8:30:00)
plot(time, yValue);
However, this restricts me to only one full day between 0:00:00 and 24:00:00. What if I wanted to include multiple days in one graph? So time = ['6/10/2013 8.5', '6/10/2013 10', '6/10/2013 15.2', '6/11/2013 4.5', '6/12/2013 15.6']
All help is appreciated, thanks!
Answers (1)
Iain
on 15 Jul 2013
Plot the times as date numbers (check the documentation for "datenum") Change the x axis labels to the "datestr" with something like:
set(gca,'XTickLabel',datestr(get(gca,'XTickLabel),fmt))
Categories
Find more on Graphics Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!