Re: Extracting data points from Plot[]
- To: mathgroup at christensen.cybernetics.net
- Subject: [mg789] Re: Extracting data points from Plot[]
- From: ianc (Ian Collier)
- Date: Wed, 19 Apr 1995 00:33:53 -0400
- Organization: Wolfram Research, Inc
In article <newsclip4413mkue3$rrh at news0.cybernetics.net>, j-guyer at nwu.edu
(Jon Guyer) wrote:
> What I'm wondering, though, is if there isn't something a bit more
> straightforward than "InputForm[%1][[1]][[1]][[2]][[1]][[1]][[1]]" to get
> at the data points? Is there a way to generate these data series the way
> Plot[] does, without using Plot (which necessitates stripping off the
> "Graphics" and "Line" structures which make up the bulk of the
> sub-sub-sub-arrays that I'm referencing).
>
> Am I being obtuse?
>
> --
> Jonathan E. Guyer j-guyer at nwu.edu
Here is a method (taken from "The Mathematica Graphics
Guidebook"). (Note that I only use Short so that the resulting
list of numbers does not take up too much bandwidth.
In[1]:=
gr1 = Plot[ Sin[x], {x,0,2 Pi}]
Out[1]=
-Graphics-
In[5]:=
p1 = Nest[ First, gr1, 4]//Short
Out[5]//Short=
-19
{{0., 0.}, <<78>>, {6.28319, 1.0842 10 }}
"The Mathematica Graphics Guidebook" by Cameron Smith and
Nancy Blachman is published by Addison-Wesley.
I hope this helps.
--Ian
----------------------------------------------------------------
Ian Collier
Technical Sales Support
Wolfram Research, Inc.
----------------------------------------------------------------
Tel (217) 398-0700 Fax (217) 398-0747 ianc at wri.com
Wolfram Research Home Page http://www.wri.com/
----------------------------------------------------------------