Re: Getting Coordinates from plot
- To: mathgroup at smc.vnet.net
- Subject: [mg32967] Re: [mg32953] Getting Coordinates from plot
- From: BobHanlon at aol.com
- Date: Fri, 22 Feb 2002 01:48:50 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
In a message dated 2/21/02 4:04:10 AM, uceswga at ucl.ac.uk writes: >I would like a list of coordinates so that I can analyze them further >and possibly import into a "prettier" graphing package. What should >I do when using the NDSolve function? > >I have tried the menu command: Input -> Get Graphics Coordinates. >This requires me to use Mod1 key which I don't have on my keyboard. > >How can I get coordinates of the plot from the following: > > >Pends[init1_, init2_, time_, k_, {c_, w_, p_}] := > Module[{}, > pend = NDSolve[{ > x1''[t] + c x1'[t] + ((1 + p Cos[w t])) Sin[x1[t]] == k (x2[t] - x1[t]), > > x2''[t] + c x2'[t] + ((1 + p Cos[w t])) Sin[x2[t]] == k (x1[t] >- x2[t]), > x1[0] == init1[[1]], x1'[0] == init1[[2]], > x2[0] == init2[[1]], x2'[0] == init2[[2]]}, > {x1, x2}, {t, 0, time}, > MaxSteps -> 200000]; > xd[t_] := x1[t] /. pend[[1]]; > xdd[t_] :=x1'[t] /.pend[[1]]; > xr[t_] := x2[t] /. pend[[1]]; > xrd[t_] :=x2'[t] /.pend[[1]]; > ]; > c = 0.1; w = 2.0; p = 2.0; > Pends[{1.37, 0}, {-1.17, 0}, 5000, 0.0, {c, w, p}]; > ParametricPlot[{ {xd[t], xdd[t]}, {xr[t], xrd[t]}}, {t, 1000, 1500}]; > plt = ParametricPlot[{ {xd[t], xdd[t]}, {xr[t], xrd[t]}}, {t, 1000, 1500}]; The data for the first plot is plt[[1, 1, 1, 1, 1]] The second plot is plt[[1, 2, 1, 1, 1]] To compare with the original plot Needs["Graphics`Graphics`"]; DisplayTogether[ ListPlot[plt[[1, 1, 1, 1, 1]], PlotJoined -> True], ListPlot[plt[[1, 2, 1, 1, 1]], PlotJoined -> True]]; Bob Hanlon Chantilly, VA USA