Small suggestion for improving pick

Hi, There have been several times when I've come across

    > conditions where I want a user to be able to pick from
    > amongst a limited number of objects on plots containing
    > lots of other objects. Previously I've written my own
    > functions to do this but it occurs to me that this is
    > likely to be something others will want to do. To this
    > end I've made a very simple addition to the Axes.pick
    > method to take a keyword argument test which, if a
    > callable, is used to filter the objects from which to
    > pick. A patch to CVS containing the alteration is
    > enclosed.

Hi Nick,

Although using a function may be the most general way of making
picking selective, I wonder if it is the most intuitive. I suspect
that 9 time out of 10, a user will just want to pass a list of objects
on which to pick. Do you agree?

JDH

I do - but for flexibility how about this patch which allows both
options? The kind of list intersection I've used isn't the most
efficient but as mpl isn't at its most efficient with large numbers of
artists I didn't think that would be a problem.

Nick

patch (927 Bytes)

···

On Mon, 2005-06-06 at 08:58 -0500, John Hunter wrote:

    > Hi, There have been several times when I've come across
    > conditions where I want a user to be able to pick from
    > amongst a limited number of objects on plots containing
    > lots of other objects. Previously I've written my own
    > functions to do this but it occurs to me that this is
    > likely to be something others will want to do. To this
    > end I've made a very simple addition to the Axes.pick
    > method to take a keyword argument test which, if a
    > callable, is used to filter the objects from which to
    > pick. A patch to CVS containing the alteration is
    > enclosed.

Hi Nick,

Although using a function may be the most general way of making
picking selective, I wonder if it is the most intuitive. I suspect
that 9 time out of 10, a user will just want to pass a list of objects
on which to pick. Do you agree?