Re: Interpolation
- To: mathgroup at yoda.physics.unc.edu
- Subject: Re: Interpolation
- From: twj
- Date: Wed, 27 Jan 93 09:27:54 CST
>2) Question: Does anyone have the code that Plot uses to build up its
>list of plot points? If not, would WRI be willing to make it available as
>a function which returns the list of plot points?
Why not use Plot?
It is quite easy to find out what points it is using.
In[31]:= l = {}
Out[31]= {}
In[32]:= Plot[ AppendTo[ l, x]; Tan[x], {x,0,1}, DisplayFunction -> Identity]
Out[32]= -Graphics-
In[33]:= l//InputForm
Out[33]//InputForm=
{0., 0.04166666666666666, 0.0833333333333333, 0.125, 0.1666666666666666,
0.2083333333333333, 0.25, 0.2916666666666666, 0.3333333333333333, 0.375,
0.4166666666666666, 0.4583333333333333, 0.5, 0.5416666666666666,
0.5833333333333333, 0.625, 0.6666666666666666, 0.7083333333333333, 0.75,
0.7916666666666666, 0.833333333333333, 0.875, 0.916666666666667,
0.958333333333333, 1.}
This is the list of x values.
We can also find out the x and y values:
In[34]:= l = {}
Out[34]= {}
In[35]:= Plot[ Part[ AppendTo[ l, {x, Tan[x]}], -1, 2], {x,0,1},
DisplayFunction -> Identity]
Out[35]= -Graphics-
In[36]:= l//InputForm
Out[36]//InputForm=
{{0., 0.}, {0., 0.}, {0.04166666666666666, 0.04169079607766161},
{0.04166666666666666, 0.04169079607766161},
{0.0833333333333333, 0.0835267719150693}, {0.125, 0.125655136575131},
{0.1666666666666666, 0.1682272183022424},
{0.2083333333333333, 0.2114006786742378}, {0.25, 0.2553419212210363},
{0.2916666666666666, 0.3002287750932093},
{0.3333333333333333, 0.3462535495105754}, {0.375, 0.3936265759256328},
{0.4166666666666666, 0.4425803840020665},
{0.4583333333333333, 0.4933746973882196}, {0.5, 0.5463024898437905},
{0.5416666666666666, 0.6016974173558721},
{0.5833333333333333, 0.6599430459842428}, {0.625, 0.7214844409909045},
{0.6666666666666666, 0.7868428894729773},
{0.7083333333333333, 0.856634825557143}, {0.75, 0.931596459944073},
{0.7916666666666666, 1.012616256834373},
{0.833333333333333, 1.100778368789801}, {0.875, 1.197421629234348},
{0.916666666666667, 1.304221045313247},
{0.958333333333333, 1.423302511569322}, {1., 1.557407724654902}}
In[37]:=
Tom Wickham-Jones
Wolfram Research Inc.