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>