ginput: blocking call for mouse input

In my applications I select multiple points from a particular line,
highlighting the point that will be selected as the mouse cursor moves.
I put a text message on the plot explaining what to do which disappears
when the selection is complete.

Some other useful cases are selecting an x-range, a y-range or a box,
with the appropriate shading for the selected region.

This is still in Tcl/Tk+BLT; I haven't moved it over to Python yet.

- Paul

···

On Tue, Feb 05, 2008 at 11:23:14PM +0100, Gael Varoquaux wrote:

On Tue, Feb 05, 2008 at 04:11:59PM -0600, John Hunter wrote:
> Also, my version of GaelInput has seemed to stop evolving. This
> version has the option to draw lines between clicks, which I use a
> lot. Also, the default timeout is 0 now, since you can always
> right-click to abort.

You can still use this behavoir, using a timeout of zero, n = 0, and the
middle click to end (I use right_click to cancel points). I am not sure
what the default timeout should be. If you have strong opinions about it
being 0, that's fine with me.

As far as n = 0 being the default, I think this is a bad idea. First of
all, it break matlab-compatibility for no good reasons, second in most
cases, IMHO, the naive programmer only wants one point, and puts some
logics afterwards. He will not read the doc, and wont understand why his
function is not returning after one click (so many people don't even know
how to read docstring, I am not kidding).

As for the lines, having lines implies that there is a connection order
in your points, which is not always the case. I suggest thus adding a
optional (oof by default) keyword argument for this behavior.

In my applications I select multiple points from a particular line,
highlighting the point that will be selected as the mouse cursor moves.
I put a text message on the plot explaining what to do which disappears
when the selection is complete.

The idea of the text message is pretty cool in term of usability.

All in all the features that you describe are relly nice. I am sure that
if you find a way to make them toolkit-agnostic they would be a great
addition to MPL.

Some other useful cases are selecting an x-range, a y-range or a box,
with the appropriate shading for the selected region.

Same thing here, this is quite nice too. I think this behavior can now be
created using ginput, but it would be cool to have it out of the box.
Sorry, I can't work on it know.

Ga�l

···

On Tue, Feb 05, 2008 at 06:46:19PM -0500, Paul Kienzle wrote: