Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #14894
| From | W Craig Carter <ccarter@MIT.EDU> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Getting the plotted data from a graph |
| Date | 2013-06-16 09:12 +0000 |
| Message-ID | <kpjvia$9na$1@smc.vnet.net> (permalink) |
| References | <20130615082448.BFAE16A7C@smc.vnet.net> |
| Organization | Time-Warner Telecom |
Hello Lily,
This should do what you are looking for:
plot = Plot[Sin[x], {x, -Pi, Pi}, PlotStyle -> None, Axes -> False,
Mesh -> All, MeshStyle -> Directive[PointSize[Medium]]]
points = Flatten[Cases[plot, GraphicsComplex[a_, ___] -> a, Infinity],
1]
W Craig Carter
Professor of Materials Science, MIT
On Jun 15, 13, at 4:24 AM, Lily T. wrote:
> Dear All,
>
> My question is regarding the plotted data points in a graph. Assume =
you draw a graph of sinx as:
>
> g1 = Plot[Sin[x], {x, -Pi, Pi},
> Frame -> True, FrameLabel -> {"x", "y"}, ImageSize -> 2.6*72
> ]
>
> then how can I get all of the data points of this graph by using =
mathematica?
>
> This is really important for me and I couldn't find the answer =
anywhere online!
>
> Thank you for your help in advance!
>
> Best,
> Lily
>
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: Getting the plotted data from a graph W Craig Carter <ccarter@MIT.EDU> - 2013-06-16 09:12 +0000
csiph-web