def clear(self):
self.graph.cla()
zero = dt.datetime.fromtimestamp(0)
one = dt.datetime.fromtimestamp(1)
x, y = [zero, one], [-1, -1]
self.graph.set_xlim(zero, one)
self.graph.set_ylim(0, 1)
self.power_line, = self.graph.plot(x, y, color='red')
self.graph.xaxis.set_major_formatter(DateFormatter("%Y-%m-%d %H:%M:%S"))
self.graph.xaxis.set_major_locator(LinearLocator(numticks=6))
plt.setp(self.graph.get_xticklabels(), rotation=10)
self.graph.set_ylabel("Power (kW)")
评论列表
文章目录