MathGroup Archive 1995

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

Search the Archive

Re: Extracting data points from Plot[]


J. Gruyer wrote

> The Plot[] function does some intelligent picking of points, such that it
> usually does a pretty good job of following twists and turns in a function
> without plotting an excessive number of points. I'm not ecstatic about
> using Mma for final output, though, so I like to export these curves to a
> graphing program.
>
> So far, I haven't been able to figure out any way to get at this
> point-picking algorithm without using Plot[]. What I'm then left with is
> doing:


Here's a trick which I picked up at a Mathematica conference.

In[1] := data = {};
	 f[x_] := x^2;
	 Plot[ AppendTo[data, {x,f[x]}]; f[x], {x,0,2},
	       DisplayFunction -> Identity];
	 data // Short

Out[4] = {{0,0},{0.0833333, 0.00694444}, <<37>>, {2,4}}

This method can be used to investigate where FindMinimum samples a function
in its search for a minimum.



Jason Tigg


  • Prev by Date: Re: Extracting data points from Plot[]
  • Next by Date: PowerExpand/InverseTrig snafu
  • Previous by thread: Re: Extracting data points from Plot[]
  • Next by thread: Re: Extracting data points from Plot[]