1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
self.figure = Figure()
self.canvas = FigureCanvasQTAgg(self.figure)
self.figure.clf()
self.canvas.figure = plt.figure(figsize=(8, 5))
ax1 = self.canvas.figure.add_subplot(111)
ax2 = self.canvas.figure.add_subplot(111)
ax3 = self.canvas.figure.add_subplot(111)
ax1.set_title ("Phases")
ax1.set_xlabel ('Date')
ax1.set_ylabel ("Valeur ")
ax1.plot_date (date, phase1, '-', label="Phase1", color='r', linewidth=1, marker='^')
ax2.plot_date (date, phase2, '-', label="Phase2", color='g', linewidth=1, marker='o')
ax3.plot_date (date, phase3, '-', label="Phase3", color='b', linewidth=1, marker='x')
self.canvas.figure.autofmt_xdate (rotation=45)
self.canvas.figure.tight_layout()
ax1.grid (True)
ax1.legend (loc='best', framealpha=0.5)
# plt.savefig ("courbe.png")
plt.show() |
Partager