[Matplotlib-users] selecting points inside plot

Thomas Caswell tcaswell at gmail.com
Tue Aug 29 22:13:59 EDT 2017


What you want to do is totally possible!

I suggest having a look at the examples in
https://matplotlib.org/examples/widgets/index.html the `ginput` method,
https://github.com/tacaswell/interactive_mpl_tutorial and Ben Root's book


On Tue, Aug 29, 2017 at 10:29 AM Jean-Philippe Grivet <
jean-philippe.grivet at wanadoo.fr> wrote:

> Hello,
> I use Win7 and the Anaconde suite of Python programs.
> I am trying to write a piece of software to demonstrate the computation
> of electric potentials. The software should ;
>      - allow a user to select (with a mouse click) a point inside a
> blank rectangle,
>      - record the x and y coordinates of  that point
>      - draw a dot at that location
>      - ask the user for the value of the charge located there and record
> that
>      - repeat a few times
>      - compute the electric potential and draw a contour plot of that
> function.
> There are several pieces of code available showing how to print the x,y
> coor-
> dinates of a mouse click but I can't devise a way to retrieve thes
> values for
> turther computations nor can I dra a dot at the corresponding location
> or insert a dialog to get the charge values.
> I would be grateful for any suggestion.
> JP Grivet
> ---
> L'absence de virus dans ce courrier électronique a été vérifiée par le
> logiciel antivirus Avast.
> https://www.avast.com/antivirus
> _______________________________________________
> 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/20170830/c40f31de/attachment.html>

More information about the Matplotlib-users mailing list