From: A. S. B. <ab...@gm...> - 2008-06-16 09:43:37
|
Dear all, I have been using the WXAgg backend with matplotlib and have been coming across an occasional error. Unfortunately, it is a little difficult to trap as it doesn't happen every time! Running on Windows with python 2.5.2, matplotlib 0.98.0 (installed from the binary) and wx version 2.8.7.1 (msw-unicode), I have produced the error by creating two figures as follows: from pylab import * t = arange(-4*pi,4*pi,0.1) y = sin(t)/t figure() plot(t,y) figure() plot(t,y*y) show() The script works correctly, but when the two figure windows are closed, I get the error messages shown at the end of this email. Commenting out the second figure() and plot() lines seems to stop the error from appearing. It is important to note, however, that this may not be the direct cause as the error doesn't always appear even with both pairs of figure() and plot() lines in. I have also tried replacing show() with: try: show() except: print "Caught exception" but no exception is caught and the error message still appears. Has anyone got any thoughts on this please? Al Error: Traceback (most recent call last): File "C:\programs\development\python25\Lib\site-packages\matplotlib\backends\backend_wx.py", line 1126, in _onMotion FigureCanvasBase.motion_notify_event(self, x, y, guiEvent=evt) File "C:\programs\development\python25\Lib\site-packages\matplotlib\backend_bases.py", line 939, in motion_notify_event self.callbacks.process(s, event) File "C:\programs\development\python25\Lib\site-packages\matplotlib\cbook.py", line 152, in process func(*args, **kwargs) File "C:\programs\development\python25\Lib\site-packages\matplotlib\backend_bases.py", line 1358, in mouse_move if self._lastCursor != cursors.POINTER: File "C:\programs\development\python25\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 14318, in __getattr__ raise PyDeadObjectError(self.attrStr % self._name) wx._core.PyDeadObjectError: The C++ part of the NavigationToolbar2WxAgg object has been deleted, attribute access no longer allowed. Traceback (most recent call last): File "C:\programs\development\python25\Lib\site-packages\matplotlib\backends\backend_wx.py", line 1126, in _onMotion FigureCanvasBase.motion_notify_event(self, x, y, guiEvent=evt) File "C:\programs\development\python25\Lib\site-packages\matplotlib\backend_bases.py", line 939, in motion_notify_event self.callbacks.process(s, event) File "C:\programs\development\python25\Lib\site-packages\matplotlib\cbook.py", line 152, in process func(*args, **kwargs) File "C:\programs\development\python25\Lib\site-packages\matplotlib\backend_bases.py", line 1358, in mouse_move if self._lastCursor != cursors.POINTER: File "C:\programs\development\python25\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 14318, in __getattr__ raise PyDeadObjectError(self.attrStr % self._name) wx._core.PyDeadObjectError: The C++ part of the NavigationToolbar2WxAgg object has been deleted, attribute access no longer allowed. Traceback (most recent call last): File "C:\programs\development\python25\Lib\site-packages\matplotlib\backends\backend_wx.py", line 1126, in _onMotion FigureCanvasBase.motion_notify_event(self, x, y, guiEvent=evt) File "C:\programs\development\python25\Lib\site-packages\matplotlib\backend_bases.py", line 939, in motion_notify_event self.callbacks.process(s, event) File "C:\programs\development\python25\Lib\site-packages\matplotlib\cbook.py", line 152, in process func(*args, **kwargs) File "C:\programs\development\python25\Lib\site-packages\matplotlib\backend_bases.py", line 1358, in mouse_move if self._lastCursor != cursors.POINTER: File "C:\programs\development\python25\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 14318, in __getattr__ raise PyDeadObjectError(self.attrStr % self._name) wx._core.PyDeadObjectError: The C++ part of the NavigationToolbar2WxAgg object has been deleted, attribute access no longer allowed. Traceback (most recent call last): File "C:\programs\development\python25\Lib\site-packages\matplotlib\backends\backend_wx.py", line 1126, in _onMotion FigureCanvasBase.motion_notify_event(self, x, y, guiEvent=evt) File "C:\programs\development\python25\Lib\site-packages\matplotlib\backend_bases.py", line 939, in motion_notify_event self.callbacks.process(s, event) File "C:\programs\development\python25\Lib\site-packages\matplotlib\cbook.py", line 152, in process func(*args, **kwargs) File "C:\programs\development\python25\Lib\site-packages\matplotlib\backend_bases.py", line 1358, in mouse_move if self._lastCursor != cursors.POINTER: File "C:\programs\development\python25\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 14318, in __getattr__ raise PyDeadObjectError(self.attrStr % self._name) wx._core.PyDeadObjectError: The C++ part of the NavigationToolbar2WxAgg object has been deleted, attribute access no longer allowed. Traceback (most recent call last): File "C:\programs\development\python25\Lib\site-packages\matplotlib\backends\backend_wx.py", line 1126, in _onMotion FigureCanvasBase.motion_notify_event(self, x, y, guiEvent=evt) File "C:\programs\development\python25\Lib\site-packages\matplotlib\backend_bases.py", line 939, in motion_notify_event self.callbacks.process(s, event) File "C:\programs\development\python25\Lib\site-packages\matplotlib\cbook.py", line 152, in process func(*args, **kwargs) File "C:\programs\development\python25\Lib\site-packages\matplotlib\backend_bases.py", line 1358, in mouse_move if self._lastCursor != cursors.POINTER: File "C:\programs\development\python25\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 14318, in __getattr__ raise PyDeadObjectError(self.attrStr % self._name) wx._core.PyDeadObjectError: The C++ part of the NavigationToolbar2WxAgg object has been deleted, attribute access no longer allowed. |