Heim  >  Fragen und Antworten  >  Hauptteil

Python: 画图,横轴显示时间(小时,分钟),纵轴显示随时间变化的另一个量。横轴怎样显示?

如题
import numpy as np
import matplotlib.pyplot as plt

plt.plot(inTime, inData, 'ro');
plt.show()
~~~~~~~~~~~~~~~~~~~~~~~
inTime是 inTime=[datetime.datetime(2015,5,4,0,0,0,5000),datetime.datetime(2015,5,4,0,1,0,5000),datetime.datetime(2015,5,4,0,2,0,5000)...]

这样plt.plot出的图,横轴无法看,怎样让横轴的点只显示小时+分钟?

PHP中文网PHP中文网2742 Tage vor1022

Antworte allen(0)Ich werde antworten

Keine Antwort
  • StornierenAntwort