Re: Reading coordinates from a 2D Plot
- To: mathgroup at smc.vnet.net
- Subject: [mg75767] Re: Reading coordinates from a 2D Plot
- From: Pratik Desai <pratikd at wolfram.com>
- Date: Thu, 10 May 2007 05:11:55 -0400 (EDT)
- References: <f1s28p$fm5$1@smc.vnet.net>
On May 9, 3:54 am, Dr Reinhard Simonovits <Reinhard.Simonov...@uni- graz.at> wrote: > Hi, > > In previous versions of Mathematica under Windows, you could read the > x,y-coordinates of a point, say the min of x^2 + 5. You could > measure the minimum by clicking on the graphics and paste it in an > input cell for further processing. > The coordinates were also displayed in the lower left corner of the window. > > With repeated steps one could get a lot of coordinates and fit them > with e.g. NonlinearFit. > > How do I do it in Mathematica 6? I need this features badly for my students. > > -Reinhard > -- > ******************************************** > Dr. Reinhard Simonovits > Handelsakademie | Karl Franzens University > Math Department | Inst. for Mathematics > Grazbachgasse 71 | Heinrichstrasse 36 > A-8010 Graz, Austria > > Email: Reinhard.Simonov... at uni-graz.at > ********************************************* Hello Reinhard, In Mathematica 6 there are several way to do this, here are two using ClickPane and EventHandler f[x_] := x^2 + 5 ls = {} ClickPane[Plot[f[x], {x, -5, 5}, PlotRange -> {Automatic, {-5, 20}}], AppendTo[ls, #] &] Dynamic@ls ls = {} EventHandler[ Plot[f[x], {x, -5, 5}, PlotRange -> {Automatic, {-5, 20}}], "MouseDown" :> AppendTo[ls, MousePosition["Graphics"]]] Dynamic@ls Hope this helps. Note that one has to evaluate all the inputs to see the dynamic evaluations. Thanks Pratik Desai Wolfram Research