[Matplotlib-users] mouse cursor coordinates
Thomas Caswell
tcaswell at gmail.com
Fri Jun 3 08:30:56 EDT 2016
See the spline example in this gist
https://gist.github.com/tacaswell/d1afcf015fc202c311bdcc477e1ca3bd and
http://matplotlib.org/users/event_handling.html
The trick is to register an instance method into the callbacks so that you
can keep state between calls.
Tom
On Fri, Jun 3, 2016 at 6:12 AM grivet <grivet at cnrs-orleans.fr> wrote:
> Hello,
> I would like to go further and, in fact, do the following:
>
> repeat n times
> click inside a figure
> retrieve and store the pointer coordinates
> show a mark (or circle or whatever) at this point
>
> Thank you for your suggestions
> JP Grivet
>
> > Right again! A separate window is now created and I can click inside
> > and retrieve the pointer coordinates.
> > Thanks a lot,
> > JP Grivet
> >
> >> Ok, I do not use spyder so I may be wrong, but it looks that it works if
> >> in the preferences windows (Tools -> Preferences)
> >> in the option:
> >> "IPython console"
> >> In the tab:
> >> "Graphics"
> >> you select the Backend:
> >> "Automatic"
> >>
> >> You probably have to restart spyder for it to work.
> >>
> >> Regards,
> >> Juan
>
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users at python.org
> https://mail.python.org/mailman/listinfo/matplotlib-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20160603/5d39d306/attachment.html>
More information about the Matplotlib-users
mailing list