pick_event after zooming/panning stops working.

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

See this minimal example

import matplotlib.pyplot as plt
fig, ax = plt.subplots()

ax.axvline(.5, picker=6)
ax.plot(range(3))
cids = []

plt.draw()

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

def click(event):
   print "clicked"

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

If you turn the zoom/pan tool off the picker works again. I suspect
that there is some logic underneath those tools that are snarfing
events when the are turned on to avoid messy conflicts. There is some
work going on (MEP22 iirc) to update the toolbar and make our tool
handling saner.

Tom

···

On Thu, Aug 21, 2014 at 9:44 AM, Michael Kaufman <kaufmanmc@...4558...> wrote:

   # 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"

--
Thomas Caswell
tcaswell@...287...

Yes, those tools do “snarf” up pick events via the widgetlock mechanism, IIRC. This is entirely intentional, and I an not sure there is a bug here to fix.

···

On Thu, Aug 21, 2014 at 12:01 PM, Thomas Caswell <tcaswell@…287…> wrote:

On Thu, Aug 21, 2014 at 9:44 AM, Michael Kaufman <kaufmanmc@…4558…> wrote:

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”

See this minimal example


import matplotlib.pyplot as plt

fig, ax = plt.subplots()



ax.axvline(.5, picker=6)

ax.plot(range(3))

cids = []



plt.draw()



def pick(event):
thisline = event.artist

   xdata, ydata = thisline.get_data()

   print xdata[0]


def click(event):

print “clicked”

cids.append(fig.canvas.mpl_connect(‘pick_event’, pick))

cids.append(fig.canvas.mpl_connect(‘button_press_event’, click))




If you turn the zoom/pan tool off the picker works again.  I suspect

that there is some logic underneath those tools that are snarfing

events when the are turned on to avoid messy conflicts.  There is some

work going on (MEP22 iirc) to update the toolbar and make our tool

handling saner.



Tom

--

Thomas Caswell

tcaswell@...287...



------------------------------------------------------------------------------

Slashdot TV.

Video for Nerds.  Stuff that matters.

[http://tv.slashdot.org/](http://tv.slashdot.org/)

_______________________________________________

Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

[https://lists.sourceforge.net/lists/listinfo/matplotlib-users](https://lists.sourceforge.net/lists/listinfo/matplotlib-users)

What kind of bad stuff happens if we were to allow that?

M

···

On 8/21/14 2:29 PM, Benjamin Root wrote:

Yes, those tools do "snarf" up pick events via the widgetlock mechanism,
IIRC. This is entirely intentional, and I an not sure there is a bug
here to fix.

On Thu, Aug 21, 2014 at 12:01 PM, Thomas Caswell <tcaswell@…287… > <mailto:tcaswell@…287…>> wrote:

    On Thu, Aug 21, 2014 at 9:44 AM, Michael Kaufman <kaufmanmc@…4558… > <mailto:kaufmanmc@…4558…>> wrote:
     >
     > # 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"

    See this minimal example

    ```
    import matplotlib.pyplot as plt
    fig, ax = plt.subplots()

    ax.axvline(.5, picker=6)
    ax.plot(range(3))
    cids = []

    plt.draw()

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

    def click(event):
        print "clicked"

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

    ```

    If you turn the zoom/pan tool off the picker works again. I suspect
    that there is some logic underneath those tools that are snarfing
    events when the are turned on to avoid messy conflicts. There is some
    work going on (MEP22 iirc) to update the toolbar and make our tool
    handling saner.

    Tom
    –
    Thomas Caswell
    tcaswell@…287… <mailto:tcaswell@…287…>

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

Imagine someone creates some event that would modify an artist upon picking, or do some expensive calculation, or some other action. But, I seriously doubt anybody would want those actions to fire while using the zoom/pan tool. Especially since the mouse cursor looks totally different. I am curious why you would expect pick events to fire while using pan/zoom. What is the user-story that compels that expectation? Perhaps I could be convinced otherwise to offer some sort of toggle.

···

On Thu, Aug 21, 2014 at 2:33 PM, Michael Kaufman <kaufmanmc@…4558…> wrote:

What kind of bad stuff happens if we were to allow that?

M

On 8/21/14 2:29 PM, Benjamin Root wrote:

Yes, those tools do “snarf” up pick events via the widgetlock mechanism,

IIRC. This is entirely intentional, and I an not sure there is a bug

here to fix.

On Thu, Aug 21, 2014 at 12:01 PM, Thomas Caswell <tcaswell@…287…

mailto:tcaswell@...287...> wrote:

On Thu, Aug 21, 2014 at 9:44 AM, Michael Kaufman <kaufmanmc@...4558...

mailto:kaufmanmc@...4558...> wrote:

 >

 >    # 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"





See this minimal example



```

import matplotlib.pyplot as plt

fig, ax = plt.subplots()



ax.axvline(.5, picker=6)

ax.plot(range(3))

cids = []



plt.draw()



def pick(event):

    thisline = event.artist

    xdata, ydata = thisline.get_data()

    print xdata[0]



def click(event):

    print "clicked"





cids.append(fig.canvas.mpl_connect('pick_event', pick))

cids.append(fig.canvas.mpl_connect('button_press_event', click))



```



If you turn the zoom/pan tool off the picker works again.  I suspect

that there is some logic underneath those tools that are snarfing

events when the are turned on to avoid messy conflicts.  There is some

work going on (MEP22 iirc) to update the toolbar and make our tool

handling saner.



Tom

--

Thomas Caswell

tcaswell@…287… mailto:tcaswell@...287...

------------------------------------------------------------------------------

Slashdot TV.

Video for Nerds.  Stuff that matters.

[http://tv.slashdot.org/](http://tv.slashdot.org/)

_______________________________________________

Matplotlib-users mailing list

Matplotlib-users@...1735...sourceforge.net

mailto:Matplotlib-users@lists.sourceforge.net

[https://lists.sourceforge.net/lists/listinfo/matplotlib-users](https://lists.sourceforge.net/lists/listinfo/matplotlib-users)

My user-story is that I have say several axvlines very close together in bunches in the standard xlim(). Take for example spectral lines (or fits to spectral lines). I want to pick a line and have the program tell me the x-location of that line. Since they're close together I need to zoom in to discriminate them. I don't want to have to zoom in, then move the mouse to unselect the zoom tool before moving the mouse back to do the pick or multiple picks.

M

PS: In GTKAgg at least, the zoom tool has a cross-hair pointer which in my opinion is even better than the arrow.

···

On 8/21/14 2:41 PM, Benjamin Root wrote:

Imagine someone creates some event that would modify an artist upon
picking, or do some expensive calculation, or some other action. But, I
seriously doubt anybody would want those actions to fire while using the
zoom/pan tool. Especially since the mouse cursor looks totally
different. I am curious why you would expect pick events to fire while
using pan/zoom. What is the user-story that compels that expectation?
Perhaps I could be convinced otherwise to offer some sort of toggle.

On Thu, Aug 21, 2014 at 2:33 PM, Michael Kaufman <kaufmanmc@…4558… > <mailto:kaufmanmc@…4558…>> wrote:

    What kind of bad stuff happens if we were to allow that?

    M

    On 8/21/14 2:29 PM, Benjamin Root wrote:

        Yes, those tools do "snarf" up pick events via the widgetlock
        mechanism,
        IIRC. This is entirely intentional, and I an not sure there is a bug
        here to fix.

        On Thu, Aug 21, 2014 at 12:01 PM, Thomas Caswell > <tcaswell@…287… <mailto:tcaswell@…287…> > <mailto:tcaswell@…287…>> wrote:

             On Thu, Aug 21, 2014 at 9:44 AM, Michael Kaufman > <kaufmanmc@…4558… <mailto:kaufmanmc@…4558…> > <mailto:kaufmanmc@…4558…>> wrote:
              >
              > # 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"

             See this minimal example

             ```
             import matplotlib.pyplot as plt
             fig, ax = plt.subplots()

             ax.axvline(.5, picker=6)
             ax.plot(range(3))
             cids = []

             plt.draw()

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

             def click(event):
                 print "clicked"

             cids.append(fig.canvas.mpl___connect('pick_event', pick))
             cids.append(fig.canvas.mpl___connect('button_press_event',
        click))

             ```

             If you turn the zoom/pan tool off the picker works again.
        I suspect
             that there is some logic underneath those tools that are
        snarfing
             events when the are turned on to avoid messy conflicts.
        There is some
             work going on (MEP22 iirc) to update the toolbar and make
        our tool
             handling saner.

             Tom
             –
             Thomas Caswell
        tcaswell@…287… <mailto:tcaswell@…287…>
        <mailto:tcaswell@…287…>

        ------------------------------__------------------------------__------------------
             Slashdot TV.
             Video for Nerds. Stuff that matters.
        http://tv.slashdot.org/
             _________________________________________________
             Matplotlib-users mailing list
        Matplotlib-users@…4325…
        <mailto:Matplotlib-users@lists.sourceforge.net>
             <mailto:Matplotlib-users@…4326…
        <mailto:Matplotlib-users@lists.sourceforge.net>>
        https://lists.sourceforge.net/__lists/listinfo/matplotlib-__users <https://lists.sourceforge.net/lists/listinfo/matplotlib-users>

I think the OP’s desire is to have pick events fire after the zoom has been triggered.

Currently, after you zoom (or pan), the zoom tool is still active until you click it again. Pick events won’t fire while the zoom tool is the selected tool, and you have to manually de-select it (i.e. click the zoom button again for pick events to work).

The current behavior is the right default choice, i.m.o., but it’s counter-intuitive when combined with pick events.

When you’re building a gui to interact with data (or, for example, when using mpldatacursor – this is a question I get a lot), a common expectation is that after you zoom once, the zoom tool is no longer active. Pick events should work again.

Currently, you have to subclass (or monkey-patch) the toolbar to make this happen. It’s a bit of a pain. (It’s more complicated that just setting fig.canvas.toolbar._active.) (If I’m wrong about that, please let me know!!!)

It would be nice to have an easier way to “deactivate” the zoom/pan tool. I think the “new” toolbar might have that, but I haven’t checked.

Cheers,

-Joe

···

On Thu, Aug 21, 2014 at 1:41 PM, Benjamin Root <ben.root@…1304…> wrote:

Imagine someone creates some event that would modify an artist upon picking, or do some expensive calculation, or some other action. But, I seriously doubt anybody would want those actions to fire while using the zoom/pan tool. Especially since the mouse cursor looks totally different. I am curious why you would expect pick events to fire while using pan/zoom. What is the user-story that compels that expectation? Perhaps I could be convinced otherwise to offer some sort of toggle.


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

On Thu, Aug 21, 2014 at 2:33 PM, Michael Kaufman <kaufmanmc@…4558…> wrote:

What kind of bad stuff happens if we were to allow that?

M

On 8/21/14 2:29 PM, Benjamin Root wrote:

Yes, those tools do “snarf” up pick events via the widgetlock mechanism,

IIRC. This is entirely intentional, and I an not sure there is a bug

here to fix.

On Thu, Aug 21, 2014 at 12:01 PM, Thomas Caswell <tcaswell@…287…

mailto:tcaswell@...287...> wrote:

On Thu, Aug 21, 2014 at 9:44 AM, Michael Kaufman <kaufmanmc@...4558...

mailto:kaufmanmc@...4558...> wrote:

 >

 >    # 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"





See this minimal example



```

import matplotlib.pyplot as plt

fig, ax = plt.subplots()



ax.axvline(.5, picker=6)

ax.plot(range(3))

cids = []



plt.draw()



def pick(event):

    thisline = event.artist

    xdata, ydata = thisline.get_data()

    print xdata[0]



def click(event):

    print "clicked"





cids.append(fig.canvas.mpl_connect('pick_event', pick))

cids.append(fig.canvas.mpl_connect('button_press_event', click))



```



If you turn the zoom/pan tool off the picker works again.  I suspect

that there is some logic underneath those tools that are snarfing

events when the are turned on to avoid messy conflicts.  There is some

work going on (MEP22 iirc) to update the toolbar and make our tool

handling saner.



Tom

--

Thomas Caswell

tcaswell@…287… mailto:tcaswell@...287...

------------------------------------------------------------------------------

Slashdot TV.

Video for Nerds.  Stuff that matters.

[http://tv.slashdot.org/](http://tv.slashdot.org/)

_______________________________________________

Matplotlib-users mailing list

Matplotlib-users@...1735...sourceforge.net

mailto:Matplotlib-users@lists.sourceforge.net

[https://lists.sourceforge.net/lists/listinfo/matplotlib-users](https://lists.sourceforge.net/lists/listinfo/matplotlib-users)

On 2014-08-21 11:55, Michael Kaufman wrote:> My user-story is that I have say several axvlines very close together in
> bunches in the standard xlim(). Take for example spectral lines (or fits
> to spectral lines). I want to pick a line and have the program tell me
> the x-location of that line. Since they're close together I need to zoom
> in to discriminate them. I don't want to have to zoom in, then move the
> mouse to unselect the zoom tool before moving the mouse back to do the
> pick or multiple picks.

  It sounds like a possible solution would be keyboard shortcuts for the toolbar tools, so that zoom could be activated/deactivated without moving the mouse.

···

--
Brendan Barnwell
"Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail."
    --author unknown

Hmm, maybe my expectations are not common. Generally when I'm zooming in on data, I want to zoom multiple times one right after another.

You always want this behavior when you're panning: you don't want the pan tool to deselect after you release the button. I'm not quite sure why anyone would want a different behavior with zoom (so I guess I'm agreeing that the current behavior with respect to keeping zoom tool selected is the right choice).

I'm just bit confused on what the big deal is. Click to pick, Click and drag to get your zoom box.

My suggestion would be something similar to the Inkscape tool interface. The spacebar switches between the select tool and the last-used tool.

M

···

On 8/21/14 3:02 PM, Joe Kington wrote:

I think the OP's desire is to have pick events fire after the zoom has
been triggered.

Currently, after you zoom (or pan), the zoom tool is still active until
you click it again. Pick events won't fire while the zoom tool is the
selected tool, and you have to manually de-select it (i.e. click the
zoom button again for pick events to work).

The current behavior is the right default choice, i.m.o., but it's
counter-intuitive when combined with pick events.

When you're building a gui to interact with data (or, for example, when
using mpldatacursor -- this is a question I get a lot), a common
expectation is that after you zoom once, the zoom tool is no longer
active. Pick events should work again.

Currently, you have to subclass (or monkey-patch) the toolbar to make
this happen. It's a bit of a pain. (It's more complicated that just
setting `fig.canvas.toolbar._active`.) (If I'm wrong about that, please
let me know!!!)

It would be nice to have an easier way to "deactivate" the zoom/pan
tool. I think the "new" toolbar might have that, but I haven't checked.

Cheers,
-Joe

Pick events, by default, won’t fire while the zoom/pan tool is active, because there is no way to distinguish between a “pick” click, and a click for performing a zoom/pan. So, the question is really, is it sensible to keep the tools active after their action. I think it is, particularly when considering the panning tool, as it may take multiple “pans” before I finding what I want.

You can easily turn the various tools on and off via keyboard shortcuts: http://matplotlib.org/users/navigation_toolbar.html#navigation-keyboard-shortcuts
Command
Keyboard Shortcut(s)
Home/Reset
h or r or home
Back
c or left arrow or backspace
Forward
v or right arrow
Pan/Zoom
p
Zoom-to-rect
o
Save
ctrl + s
Toggle fullscreen
ctrl + f
Close plot
ctrl + w
Constrain pan/zoom to x axis
hold x when panning/zooming with mouse
Constrain pan/zoom to y axis
hold y when panning/zooming with mouse
Preserve aspect ratio
hold CONTROL when panning/zooming with mouse
Toggle grid
g when mouse is over an axes
Toggle x axis scale (log/linear)
L or k when mouse is over an axes
Toggle y axis scale (log/linear)
l when mouse is over an axes

Does this solve the issue, or do we need something more configurable?

Cheers!

Ben Root

···

On Thu, Aug 21, 2014 at 3:02 PM, Joe Kington <joferkington@…287…> wrote:

I think the OP’s desire is to have pick events fire after the zoom has been triggered.

Currently, after you zoom (or pan), the zoom tool is still active until you click it again. Pick events won’t fire while the zoom tool is the selected tool, and you have to manually de-select it (i.e. click the zoom button again for pick events to work).

The current behavior is the right default choice, i.m.o., but it’s counter-intuitive when combined with pick events.

When you’re building a gui to interact with data (or, for example, when using mpldatacursor – this is a question I get a lot), a common expectation is that after you zoom once, the zoom tool is no longer active. Pick events should work again.

Currently, you have to subclass (or monkey-patch) the toolbar to make this happen. It’s a bit of a pain. (It’s more complicated that just setting fig.canvas.toolbar._active.) (If I’m wrong about that, please let me know!!!)

It would be nice to have an easier way to “deactivate” the zoom/pan tool. I think the “new” toolbar might have that, but I haven’t checked.

Cheers,

-Joe

On Thu, Aug 21, 2014 at 1:41 PM, Benjamin Root <ben.root@…1304…> wrote:

Imagine someone creates some event that would modify an artist upon picking, or do some expensive calculation, or some other action. But, I seriously doubt anybody would want those actions to fire while using the zoom/pan tool. Especially since the mouse cursor looks totally different. I am curious why you would expect pick events to fire while using pan/zoom. What is the user-story that compels that expectation? Perhaps I could be convinced otherwise to offer some sort of toggle.


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

On Thu, Aug 21, 2014 at 2:33 PM, Michael Kaufman <kaufmanmc@…4017…558…> wrote:

What kind of bad stuff happens if we were to allow that?

M

On 8/21/14 2:29 PM, Benjamin Root wrote:

Yes, those tools do “snarf” up pick events via the widgetlock mechanism,

IIRC. This is entirely intentional, and I an not sure there is a bug

here to fix.

On Thu, Aug 21, 2014 at 12:01 PM, Thomas Caswell <tcaswell@…287…

mailto:tcaswell@...287...> wrote:

On Thu, Aug 21, 2014 at 9:44 AM, Michael Kaufman <kaufmanmc@...4558...

mailto:kaufmanmc@...4558...> wrote:

 >

 >    # 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"





See this minimal example



```

import matplotlib.pyplot as plt

fig, ax = plt.subplots()



ax.axvline(.5, picker=6)

ax.plot(range(3))

cids = []



plt.draw()



def pick(event):

    thisline = event.artist

    xdata, ydata = thisline.get_data()

    print xdata[0]



def click(event):

    print "clicked"





cids.append(fig.canvas.mpl_connect('pick_event', pick))

cids.append(fig.canvas.mpl_connect('button_press_event', click))



```



If you turn the zoom/pan tool off the picker works again.  I suspect

that there is some logic underneath those tools that are snarfing

events when the are turned on to avoid messy conflicts.  There is some

work going on (MEP22 iirc) to update the toolbar and make our tool

handling saner.



Tom

--

Thomas Caswell

tcaswell@…287… mailto:tcaswell@...287...

------------------------------------------------------------------------------

Slashdot TV.

Video for Nerds.  Stuff that matters.

[http://tv.slashdot.org/](http://tv.slashdot.org/)

_______________________________________________

Matplotlib-users mailing list

Matplotlib-users@...1735...sourceforge.net

mailto:Matplotlib-users@lists.sourceforge.net

[https://lists.sourceforge.net/lists/listinfo/matplotlib-users](https://lists.sourceforge.net/lists/listinfo/matplotlib-users)

I think there is: for a zoom/pan, the mouse must move a certain distance to be considered the start of a zoom or pan (button down -> drag -> button up). A pick can be just a click (button down -> button up, no or minimal change in mouse position <1,2 pts?).

M

···

On 8/21/14 3:22 PM, Benjamin Root wrote:

Pick events, by default, won't fire while the zoom/pan tool is active,
because there is no way to distinguish between a "pick" click, and a
click for performing a zoom/pan.