|
From: C M <cmp...@gm...> - 2014-06-08 03:04:03
|
On Sat, Jun 7, 2014 at 10:18 PM, Eric Firing <ef...@ha...> wrote: > On 2014/06/07, 4:12 PM, C M wrote: > > I had been using a custom function (written originally by Jae-Joon and > > modified a little by me...quite a long time back now) that was working > > to allow point picking of markers, but *not* the line connecting them. > > However, I've now discovered with the help of this list that the > > function I am using has the disadvantage that if there are more than 100 > > data points, I can't get the correct index for the picked marker (turned > > out not to be a mpl bug: > > https://github.com/matplotlib/matplotlib/issues/3124). > > > > So I can just use the default pick event, but then the user can pick > > anywhere on the connecting line, which is meaningless in this use--so I > > don't want them to be able to pick on the connecting line. > > Why not just execute plot twice, once with the markers, with picking > activated, and a second time with the line, with picking inactive (the > default). > > Eric > That is so simple, and I hadn't thought of it at all. Thank you! My only concerns would be for slowness of plotting if there are a lot of points and just code simplicity, and so if there could be some other way with a custom function for the picker that would do this, I would probably prefer that. But maybe neither of these are particularly important concerns. Che |