Hi Yagua,

On Friday 12 February 2010 17:04:27 Yagua Rovi wrote:
> Hello world!
> I am displaying on my screen a set of data corresponding to points
> defined by a longitude and latitude.
> The display is fine with the command imshow (mydata ,...)
>
> I would like now associate to the application  a callback that draw a
> rectangle on two consecutive left mouse's button press defined by its two
> opposite vertices.
> (also returns points) and a right click button that erases the rectangle.

Why don't you want for select the rectangle using the rectangle selector?
I attached an example (modified version of example 'rectangle_selector.py') 
showing its usage. You can delete lines using the key 'd' or 'D'.

Furthermore I attached a script, which uses button_press_event s as you 
proposed above.

I hope at least one of the examples helps you.

Kind regards,
Matthias

Attachment: draw_rectangle_using_button_press_events.py
Description: application/python

Attachment: draw_rectangle_using_rectangle_selector.py
Description: application/python

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to