MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Getting Coordinates from plot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg32975] Re: [mg32953] Getting Coordinates from plot
  • From: Tomas Garza <tgarza01 at prodigy.net.mx>
  • Date: Fri, 22 Feb 2002 01:49:02 -0500 (EST)
  • References: <200202210707.CAA02185@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Immediately after you execute your code as it is in your message, obtain the
FullForm of your plot and extract the coordinates you want:

In[1]:=
(your code)

In[2]:=
ff = FullForm[%];

In[3]:=
Cases[ff, {x_, y_}, Infinity]

In this example you get a very long list because the plot is so ugly.

Tomas Garza
Mexico City

----- Original Message -----
From: "Winston Garira" <uceswga at ucl.ac.uk>
To: mathgroup at smc.vnet.net
Subject: [mg32975] [mg32953] Getting Coordinates from plot


> Hi,
>
> Can someone help me on this one.
> 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}];
>
>
>
>  Winston
>
>



  • Prev by Date: Re: Getting Coordinates from plot
  • Next by Date: Re: function defining including solve command
  • Previous by thread: Getting Coordinates from plot
  • Next by thread: Re: Getting Coordinates from plot