필터 지우기
필터 지우기

Plotting multiple days on one graph

조회 수: 2 (최근 30일)
Benson
Benson 2013년 7월 15일
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!

답변 (1개)

Iain
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))

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by