I am writing a GUI program in Tkinter which allows the user to enter in different parameters specifying an ellipse segment. Then, he/she presses a button and the ellipse segment is plotted, using matplotlib. Here is the code (inside a class, but logically stands alone) that does this:
It works the first time, but if the user closes the window and then tries to plot it again, only a blank graph shows up. I have tried using pyplot.show(), and I get the same result. Even if I insert pyplot.close() at the top, to close all figures, it still does not change this. Using the figure manager and interactive mode also do not change this result. I have searched through the documentation and message boards all over the place but cannot find an explanation for this. I have the most up-to-date version of matplotlib (for Python 2.6). Why is this happening?
Thanks in advance for any help
Code:
aa = DataArray(self.file0) #Retrieve data sets
bb = DataArray(self.file1) #Not used right now
cc = DataArray(self.file2) #Not used right now
curr = DataArray(self.file3)#Not used right now
x = aa.x #Get the abcissa values from the initial data set
ideal = IdealEllipse(float(self.r.get()) , float(self.r.get()), float(self.r.get()),xall)
plt1 = plt.plot(x,ideal)
plt.draw()
It works the first time, but if the user closes the window and then tries to plot it again, only a blank graph shows up. I have tried using pyplot.show(), and I get the same result. Even if I insert pyplot.close() at the top, to close all figures, it still does not change this. Using the figure manager and interactive mode also do not change this result. I have searched through the documentation and message boards all over the place but cannot find an explanation for this. I have the most up-to-date version of matplotlib (for Python 2.6). Why is this happening?
Thanks in advance for any help
Comment