You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(12) |
Sep
(12) |
Oct
(56) |
Nov
(65) |
Dec
(37) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(59) |
Feb
(78) |
Mar
(153) |
Apr
(205) |
May
(184) |
Jun
(123) |
Jul
(171) |
Aug
(156) |
Sep
(190) |
Oct
(120) |
Nov
(154) |
Dec
(223) |
| 2005 |
Jan
(184) |
Feb
(267) |
Mar
(214) |
Apr
(286) |
May
(320) |
Jun
(299) |
Jul
(348) |
Aug
(283) |
Sep
(355) |
Oct
(293) |
Nov
(232) |
Dec
(203) |
| 2006 |
Jan
(352) |
Feb
(358) |
Mar
(403) |
Apr
(313) |
May
(165) |
Jun
(281) |
Jul
(316) |
Aug
(228) |
Sep
(279) |
Oct
(243) |
Nov
(315) |
Dec
(345) |
| 2007 |
Jan
(260) |
Feb
(323) |
Mar
(340) |
Apr
(319) |
May
(290) |
Jun
(296) |
Jul
(221) |
Aug
(292) |
Sep
(242) |
Oct
(248) |
Nov
(242) |
Dec
(332) |
| 2008 |
Jan
(312) |
Feb
(359) |
Mar
(454) |
Apr
(287) |
May
(340) |
Jun
(450) |
Jul
(403) |
Aug
(324) |
Sep
(349) |
Oct
(385) |
Nov
(363) |
Dec
(437) |
| 2009 |
Jan
(500) |
Feb
(301) |
Mar
(409) |
Apr
(486) |
May
(545) |
Jun
(391) |
Jul
(518) |
Aug
(497) |
Sep
(492) |
Oct
(429) |
Nov
(357) |
Dec
(310) |
| 2010 |
Jan
(371) |
Feb
(657) |
Mar
(519) |
Apr
(432) |
May
(312) |
Jun
(416) |
Jul
(477) |
Aug
(386) |
Sep
(419) |
Oct
(435) |
Nov
(320) |
Dec
(202) |
| 2011 |
Jan
(321) |
Feb
(413) |
Mar
(299) |
Apr
(215) |
May
(284) |
Jun
(203) |
Jul
(207) |
Aug
(314) |
Sep
(321) |
Oct
(259) |
Nov
(347) |
Dec
(209) |
| 2012 |
Jan
(322) |
Feb
(414) |
Mar
(377) |
Apr
(179) |
May
(173) |
Jun
(234) |
Jul
(295) |
Aug
(239) |
Sep
(276) |
Oct
(355) |
Nov
(144) |
Dec
(108) |
| 2013 |
Jan
(170) |
Feb
(89) |
Mar
(204) |
Apr
(133) |
May
(142) |
Jun
(89) |
Jul
(160) |
Aug
(180) |
Sep
(69) |
Oct
(136) |
Nov
(83) |
Dec
(32) |
| 2014 |
Jan
(71) |
Feb
(90) |
Mar
(161) |
Apr
(117) |
May
(78) |
Jun
(94) |
Jul
(60) |
Aug
(83) |
Sep
(102) |
Oct
(132) |
Nov
(154) |
Dec
(96) |
| 2015 |
Jan
(45) |
Feb
(138) |
Mar
(176) |
Apr
(132) |
May
(119) |
Jun
(124) |
Jul
(77) |
Aug
(31) |
Sep
(34) |
Oct
(22) |
Nov
(23) |
Dec
(9) |
| 2016 |
Jan
(26) |
Feb
(17) |
Mar
(10) |
Apr
(8) |
May
(4) |
Jun
(8) |
Jul
(6) |
Aug
(5) |
Sep
(9) |
Oct
(4) |
Nov
|
Dec
|
| 2017 |
Jan
(5) |
Feb
(7) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
1
|
2
(1) |
|
3
(1) |
4
(3) |
5
(1) |
6
(5) |
7
(7) |
8
|
9
|
|
10
(1) |
11
(7) |
12
(2) |
13
|
14
(1) |
15
(4) |
16
(1) |
|
17
|
18
|
19
|
20
|
21
(12) |
22
(1) |
23
|
|
24
(2) |
25
(4) |
26
(1) |
27
(15) |
28
(7) |
29
(4) |
30
(2) |
|
31
(1) |
|
|
|
|
|
|
|
From: Michael K. <kau...@or...> - 2014-08-21 19:30:28
|
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. |
|
From: Benjamin R. <ben...@ou...> - 2014-08-21 19:23:17
|
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 <jof...@gm...> 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...@ou...> 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 <kau...@or...> >> 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 <tca...@gm... >>>> <mailto:tca...@gm...>> wrote: >>>> >>>> On Thu, Aug 21, 2014 at 9:44 AM, Michael Kaufman < >>>> kau...@or... >>>> <mailto:kau...@or...>> 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 >>>> tca...@gm... <mailto:tca...@gm...> >>>> >>>> >>>> ------------------------------------------------------------ >>>> ------------------ >>>> Slashdot TV. >>>> Video for Nerds. Stuff that matters. >>>> http://tv.slashdot.org/ >>>> _______________________________________________ >>>> Matplotlib-users mailing list >>>> Mat...@li... >>>> <mailto:Mat...@li...> >>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>>> >>>> >>>> >>> >> >> >> ------------------------------------------------------------------------------ >> Slashdot TV. >> Video for Nerds. Stuff that matters. >> http://tv.slashdot.org/ >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > |
|
From: Michael K. <kau...@or...> - 2014-08-21 19:19:51
|
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 > |
|
From: Brendan B. <bre...@br...> - 2014-08-21 19:15:05
|
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
|
|
From: Joe K. <jof...@gm...> - 2014-08-21 19:02:30
|
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...@ou...> 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 <kau...@or...>
> 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 <tca...@gm...
>>> <mailto:tca...@gm...>> wrote:
>>>
>>> On Thu, Aug 21, 2014 at 9:44 AM, Michael Kaufman <kau...@or...
>>> <mailto:kau...@or...>> 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
>>> tca...@gm... <mailto:tca...@gm...>
>>>
>>>
>>> ------------------------------------------------------------
>>> ------------------
>>> Slashdot TV.
>>> Video for Nerds. Stuff that matters.
>>> http://tv.slashdot.org/
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> <mailto:Mat...@li...>
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>>
>>>
>>
>
>
> ------------------------------------------------------------------------------
> Slashdot TV.
> Video for Nerds. Stuff that matters.
> http://tv.slashdot.org/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
|
|
From: Michael K. <kau...@or...> - 2014-08-21 18:55:23
|
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 <kau...@or...
> <mailto:kau...@or...>> 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
> <tca...@gm... <mailto:tca...@gm...>
> <mailto:tca...@gm... <mailto:tca...@gm...>>> wrote:
>
> On Thu, Aug 21, 2014 at 9:44 AM, Michael Kaufman
> <kau...@or... <mailto:kau...@or...>
> <mailto:kau...@or... <mailto:kau...@or...>>> 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
> tca...@gm... <mailto:tca...@gm...>
> <mailto:tca...@gm... <mailto:tca...@gm...>>
>
>
>
> ------------------------------__------------------------------__------------------
> Slashdot TV.
> Video for Nerds. Stuff that matters.
> http://tv.slashdot.org/
> _________________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.__sourceforge.net
> <mailto:Mat...@li...>
> <mailto:Matplotlib-users@__lists.sourceforge.net
> <mailto:Mat...@li...>>
> https://lists.sourceforge.net/__lists/listinfo/matplotlib-__users <https://lists.sourceforge.net/lists/listinfo/matplotlib-users>
>
>
>
>
|
|
From: Benjamin R. <ben...@ou...> - 2014-08-21 18:41:30
|
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 <kau...@or...> 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 <tca...@gm...
>> <mailto:tca...@gm...>> wrote:
>>
>> On Thu, Aug 21, 2014 at 9:44 AM, Michael Kaufman <kau...@or...
>> <mailto:kau...@or...>> 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
>> tca...@gm... <mailto:tca...@gm...>
>>
>>
>> ------------------------------------------------------------
>> ------------------
>> Slashdot TV.
>> Video for Nerds. Stuff that matters.
>> http://tv.slashdot.org/
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> <mailto:Mat...@li...>
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>>
>
|
|
From: Michael K. <kau...@or...> - 2014-08-21 18:33:17
|
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 <tca...@gm...
> <mailto:tca...@gm...>> wrote:
>
> On Thu, Aug 21, 2014 at 9:44 AM, Michael Kaufman <kau...@or...
> <mailto:kau...@or...>> 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
> tca...@gm... <mailto:tca...@gm...>
>
> ------------------------------------------------------------------------------
> Slashdot TV.
> Video for Nerds. Stuff that matters.
> http://tv.slashdot.org/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> <mailto:Mat...@li...>
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
|
|
From: Benjamin R. <ben...@ou...> - 2014-08-21 18:29:37
|
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 <tca...@gm...> wrote:
> On Thu, Aug 21, 2014 at 9:44 AM, Michael Kaufman <kau...@or...>
> 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
> tca...@gm...
>
>
> ------------------------------------------------------------------------------
> Slashdot TV.
> Video for Nerds. Stuff that matters.
> http://tv.slashdot.org/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
|
|
From: Thomas C. <tca...@gm...> - 2014-08-21 16:02:05
|
On Thu, Aug 21, 2014 at 9:44 AM, Michael Kaufman <kau...@or...> 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
tca...@gm...
|
|
From: Thomas R. <tho...@gm...> - 2014-08-21 15:38:13
|
Hello,
I am interested in using the Matplotlib transformation framework to
transform a rectangle into a different coordinate system. I am therefore
defining a Rectangle patch and setting the transform to what I want. If
I apply a non-linear transformation, the edges of the rectangle should
no longer necessarily be straight lines. Consider the following example:
---
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.transforms import Affine2D
from matplotlib.patches import Rectangle, Polygon
fig = plt.figure()
ax = fig.add_subplot(1,1,1)
transform = Affine2D().rotate_deg(2) + ax.transData
# Add rectangle
r = Rectangle((0.5,0.5),width=10,height=10,
transform=transform,
edgecolor='red', facecolor='none')
ax.add_patch(r)
# Add oversampled rectangle
x = np.array([0.5, 10.5, 10.5, 0.5, 0.5])
y = np.array([0.5, 0.5, 10.5, 10.5, 0.51])
x_i = np.interp(np.linspace(0., 4., 10000), np.arange(5), x)
y_i = np.interp(np.linspace(0., 4., 10000), np.arange(5), y)
p = Polygon(list(zip(x_i, y_i)),
transform=transform,
edgecolor='green', facecolor='none')
ax.add_patch(p)
ax.set_xscale('log')
ax.set_yscale('log')
fig.savefig('test.png')
---
The green lines show what I would expect the rectangle to look like, and
the red is what it ends up looking like if I use the Rectangle patch.
What must be happening is that only the vertices of the rectangle get
transformed and then are connected by straight lines.
So my question is, is there a way to make the Rectangle patch behave
like the custom polygon I'm creating here?
Thanks for any advice,
Cheers,
Tom
|
|
From: Michael K. <kau...@or...> - 2014-08-21 13:44:30
|
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
|