Re: Thank you
- To: mathgroup@smc.vnet.net
- Subject: [mg10917] Re: Thank you
- From: Allan Hayes <hay@haystack.demon.co.uk>
- Date: Thu, 12 Feb 1998 20:15:59 -0500
- References: <6brg0h$eau@smc.vnet.net>
Mingwu Bai wrote:
> Please kindly tell
> me h ow to output the calculation results to a file, not to a
> graph.
>
> For example,
> Plot[Sin[x], {x, 0, 3.14}]
> I want to output the both the x and Sin[x] results to a file (e.g.,
> "filename").
First extract the coordinates:
data =
Join@@Cases[
Plot[Sin[x], {x, 0, 3.14},DisplayFunction -> Identity],
Line[pts_]->pts,
Infinity
];
Where:
DisplayFunction -> Identity suppresses display Line[pts_]->pts extracts
the coordinates Infinity makes Sases search at all levels Join joins
the coordinate lists from several line segments (there is only one
segment here)
Now write to file
Write["sinfile",data]
--
Allan Hayes
Training and Consulting
Leicester, UK
hay@haystack.demon.co.uk
http://www.haystack.demon.co.uk
voice: +44 (0)116 271 4198
fax: +44 (0)116 271 8642