ginput_rect

Hi,

I wanted to be able to select a rectangular region from the graph as one part of a script so I combined BlockingInput and RectangleSelector to create BlockingRectangleSelector, and the pylab style interface function, ginput_rect

This serves my immediate needs and I'm unlikely to develop it further.

Before adding it to matplotlib a couple of changes are needed::

* Other kinds of selectors, such as span, line and lasso should be possible

* Selectors such as RectangularSelector can be added to a set of axes but not removed. Removing them requires unhooking the mpl_connect callbacks, but the cid is not being saved.

* The graph wasn't always drawn before selection in ipython or before a subsequent show() so I forced it with explicit draw_idle() calls. This may lead to unnecessary redraws.

- Paul

ginput_rect.py (3.08 KB)