datetime.datetime(2014, 5, 13, int(p/60), p%60) for p in mins])
plt.plot(times[1::20], data[1::20])
如何将x轴形状更改为HH:MM?我尝试使用datetime.time()函数而不是datetime.datetime(),但是这会导致错误。
该列表包括相同的日期,只是时间从一个列表项更改到下一个列表项。# float() argument must be a string or a number, not 'datetime.time'
y = [e.time() for e in events]在阅读完SO上的后,我可以通过以下操作获得我需要的