|
From: C M <cmp...@gm...> - 2014-06-08 02:12:33
|
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. My goal is to have a custom function that will serve *both* purposes: allow picking the markers only, not the line, of a set of data of any length while returning the correct index of that marker/data point. But the code in the custom function is mostly above my head, was written for mpl 0.99 or so, and I don't know how to modify it to get both purposes achieved. I attach the current sample again, with the problematic custom picker function, "contains_points()". Thanks for any suggestions or help. Che |