Plotting multiple days on one graph
2 ビュー (過去 30 日間)
古いコメントを表示
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!
0 件のコメント
回答 (1 件)
Iain
2013 年 7 月 15 日
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))
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!