This is a wild guess -- sounds like a race condition where the mouse up 
event is somehow getting fired before the mouse down event.

In your more complex example, are you adding/removing axes while 
interacting with the plots?

You could try "papering over" this problem by replacing Axes.end_pan 
with the following (I'm not entirely sure this is a good idea, but I'm 
curious if it prevents the sluggishness):

     def end_pan(self):
         """
         Called when a pan operation completes (when the mouse button
         is up.)

         .. note::
             Intended to be overridden by new projection types.
         """
         if hasattr(self, '_pan_start'):
             del self._pan_start

Mike

On 12/18/2010 01:52 PM, John Haiducek wrote:
> I have an application with two matplotlib figures, both using the gtkAgg
> backend. One or the other is displayed on the screen depending on the
> GUI state. Initially after creating the two figures, I can interact with
> both of them just fine, but after switching between figures two or three
> times the figure becomes sluggish in handling pans and zooms, and I
> start getting errors like this while panning:
>
> Traceback (most recent call last):
>    File
> "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_gtk.py", line
> 216, in button_release_event
>      FigureCanvasBase.button_release_event(self, x, y, event.button,
> guiEvent=event)
>    File "/usr/lib/pymodules/python2.6/matplotlib/backend_bases.py", line
> 1219, in button_release_event
>      self.callbacks.process(s, event)
>    File "/usr/lib/pymodules/python2.6/matplotlib/cbook.py", line 165, in
> process
>      func(*args, **kwargs)
>    File "/usr/lib/pymodules/python2.6/matplotlib/backend_bases.py", line
> 2016, in release_pan
>      a.end_pan()
>    File "/usr/lib/pymodules/python2.6/matplotlib/axes.py", line 2458, in
> end_pan
>      del self._pan_start
> AttributeError: _pan_start
>
> I tried to create a minimum working example but so far have been
> unsuccessful; the problem did not recur in the simpler program I created.
>
> Can anyone suggest to me where I would look to find what could cause
> this error and the (presumably related) performance degradation?
>
> ------------------------------------------------------------------------------
> Lotusphere 2011
> Register now for Lotusphere 2011 and learn how
> to connect the dots, take your collaborative environment
> to the next level, and enter the era of Social Business.
> http://p.sf.net/sfu/lotusphere-d2d
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>    


-- 
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA


------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to