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 27 28 29 30 31 32 33 34 35 36 37 38
|
#This boolean is used to allow for multiple graphes to be shown on the same panel.
firstPlot = False
#Plot graph and display it
if(self.DropDownListDisplaySector2_1.currentIndex() != self.currentSectorPlot2_1):
self.numFiguresPlot2_1 = self.numFiguresPlot2_1 + 1
self.currentSectorPlot2_1 = self.DropDownListDisplaySector2_1.currentIndex()
firstPlot = True
fig = plt.figure(self.numFiguresPlot2_1)
fig.canvas.set_window_title(self.DropDownListDisplaySector2_1.currentText())
plt.hold(True)
x = np.arange(0, self.stockParam.nTotZones, 1);
#y = matrix4["Price"].convert_objects(convert_numeric=True)
y = pd.to_numeric(matrix4["Price"])
print("Moyenne = ")
print(y.mean(0))
#z = (matrix4["Adjust"].convert_objects(convert_numeric=True)*y)/100 + y
z = pd.to_numeric(matrix4["Adjust"]*y)/100 + y
if(firstPlot):
price = plt.plot(x, y, label = ("Price"))
shadowPrice = plt.plot(x, z, label = ("Price + adjust for iteration "+self.DropDownListDisplayIter2_1.currentText()))
plt.legend()
plt.show(block=False) #method 3
plt.draw() |
Partager