Getting coordinates of the zoom rectangle

Dear Gökhan,

Thanks for your reply, but unfortunately it was not entirely helpful.

The rectangle_selector.py exemple indeed seems to do what I want, by

means of a callback function, however in the example program this

function should print the rectangle coordinates to the screen but it

does nothing.

Check the shell where you called the script. It updates when select a region and release the mouse.

BTW, where is the documentation for the matplotlib.widgets classes? I

could find none.

Just browse the actual source …/lib/matplotlib/widgets.py. Classes are methods are nicely documented. I would suggest you to use IPython to access the docstrings with ease.

import matplotlib.widgets as w

w?

w.

···

On Mon, Apr 5, 2010 at 3:17 PM, Mauro Cavalcanti <maurobio@…287…> wrote:

Best regards,

2010/4/5 Gökhan Sever <gokhansever@…287…>:

On Mon, Apr 5, 2010 at 6:39 AM, Mauro Cavalcanti <maurobio@…287…> wrote:

Dear ALL,

Good morning… Here is a question that may already have been asked

(and answered), but not to my knowledge. Matplotlib’s figure windows

come with that handy navigation bar, which includes a Pan/Zoom button

and a Zoom-to-rectangle button. Once a zoom rectangle is defined on a

figure, is it possible to get the coordinates of it (that is, the

lower and upper corner coordinates which define the zoom rectangle)?

If so, how can this be done?

Thanks in advance for any reply.

With best regards,

Dr. Mauro J. Cavalcanti

P.O. Box 46521, CEP 20551-970

Rio de Janeiro, RJ, BRASIL

E-mail: maurobio@…287…

Web: http://sites.google.com/site/maurobio

Linux Registered User #473524 * Ubuntu User #22717

Hi,

Search for zoom_window.py and rectangle_selector.py in your matplotlib

examples directory.

Gökhan

Dr. Mauro J. Cavalcanti

P.O. Box 46521, CEP 20551-970

Rio de Janeiro, RJ, BRASIL

E-mail: maurobio@…287…

Web: http://sites.google.com/site/maurobio

Linux Registered User #473524 * Ubuntu User #22717


Gökhan