From d8df3ea11ad75c5226c250d6ec094072cd14adf6 Mon Sep 17 00:00:00 2001 From: Worros Date: Thu, 16 Jul 2009 11:46:52 +0800 Subject: [PATCH] Possible fix for 2.6 versions of Matplotlib Long standing issue with multiple plots being added to a single canvas. Calling canvas.draw() appears to be the "correct" way to do this in pythin 2.6 Need someone to test if this still works in python 2.5 --- pyfpdb/GuiGraphViewer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pyfpdb/GuiGraphViewer.py b/pyfpdb/GuiGraphViewer.py index e3f08b75..c52ebe1d 100644 --- a/pyfpdb/GuiGraphViewer.py +++ b/pyfpdb/GuiGraphViewer.py @@ -126,11 +126,12 @@ class GuiGraphViewer (threading.Thread): #end def get_vbox def clearGraphData(self): - self.fig.clf() + self.fig.clear() if self.canvas is not None: self.canvas.destroy() - self.canvas = FigureCanvas(self.fig) # a gtk.DrawingArea + if self.canvas == None: + self.canvas = FigureCanvas(self.fig) # a gtk.DrawingArea def generateGraph(self, widget, data): self.clearGraphData() @@ -197,6 +198,7 @@ class GuiGraphViewer (threading.Thread): self.graphBox.add(self.canvas) self.canvas.show() + self.canvas.draw() #self.exportButton.set_sensitive(True) #end of def showClicked