Hi,

ipython 3.0.0-dev
matplotlib 1.3.1
GTKAgg backend
mac osx 10.9

If I create a pick_event on an axvline (with picker=6), there is no 
problem triggering the pick event the first time the figure is shown (or 
many times if I _don't_ zoom or pan). But if I then zoom in or pan 
(using the toolbar tools) the pick_event function stops triggering.

The button_press_event that I also created still works after 
zooming/panning. The pick_event still doesn't work even if I disconnect 
all the events and recreate them (by creating a new object).
I have to close the figure and make a new one to make the pick work 
again. The button_press_event always works.

This is the bottom of the plotting function:

   # plot axvlines here... etc.

   global cids

   # remove any previous connections
   for i in cids:
      gcf().canvas.mpl_disconnect(i)
   cids = []

   cids.append(gcf().canvas.mpl_connect('pick_event',self.pick))
   cids.append(gcf().canvas.mpl_connect('button_press_event',self.click))

   draw()

def pick(self, event):
   thisline = event.artist
   xdata, ydata = thisline.get_data()
   print xdata[0]

def click(self, event):
   print "clicked"

Anybody got a clue what's going on? Does the Line2D get deleted and 
recreated without the picker enabled?

M


------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to