Current date being plotted on graph with time data
3 次查看(过去 30 天)
显示 更早的评论
S1_NB = Data(Data.RoadSection=='High St to Highbury',:);
figure(1)
fig1 = figure(1);
left_color = [0 0 0];
right_color = [0 0 0];
set(fig1,'defaultAxesColorOrder',[left_color; right_color])
title('Segment 1: Northbound')
yyaxis left
plot(S1_NB.Time,S1_NB.AvgTT,'-r')
xlim([S1_NB.Time(1),S1_NB.Time(end)])
ylim([60 135])
grid on
xlabel('Time of Day')
ylabel('Travel Time (seconds)')
hold on
plot(S1_NB.Time,S1_NB.FreeTT)
yyaxis right
plot(S1_NB.Time,S1_NB.No_Vehicles)
ylabel('Number of Vehicles')
Plotting some data against time data, the format is in 'hh:mm:ss aa' but all my figures have a singular date stamp of todays date on the x axis.
9 个评论
Walter Roberson
2021-10-16
[H,M,S] = hms(Data.Time);
Data.Time = duration(H, M, S);
After that, Data.Time should plot without the date component.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Title 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!