Message Boards Message Boards

0
|
3926 Views
|
1 Reply
|
4 Total Likes
View groups...
Share
Share this post:

Interpolating Function Issue

Posted 12 years ago
I have been given a graph with a set of coordinates: 
 immigrationdata =
 {{1825,0.015},{1835,0.060},{1845,0.171},
 {1855,0.260},{1865,0.215},{1875,0.281},{1885,0.525},
 {1895,0.369},{1905,0.880},{1915,0.574},{1925,0.411},
 {1935,.053},{1945,0.104},{1955,0.252},{1965,0.332},
 {1975,0.449},{1985,0.734}};
 
 immigrationdataplot = ListPlot[immigrationdata,  AxesLabel->{"year","immigrants"},
 PlotStyle->{Darker[Green],PointSize[0.03]}]
And I am asked to "to run a function through the data"
So I tried to use Mathematica's interpolation function:
Clear[impop];
impop[t_] = Interpolation[immigrationdata][t]
InterpolatingFunction[{{1825.,1985.}},<>][t]
functplot = Plot[impop[t],{t,1825,1985},
PlotStyle->{{Thickness[0.01],GrayLevel[0.5]}},
PlotRange->All,AspectRatio->1];

Show[immigrationdata,functplot,PlotRange->All,
   AxesLabel->{"t","Immigrants"}]
But mathematica cannot compute this saying "could not combine the graphics"
What am I doing wrong?
POSTED BY: bill bluet
This is only a minor typo. You wanted to write immigrationdataplot in the last command:

Show[immigrationdataplot, functplot, PlotRange -> All,
AxesLabel -> {"t", "Immigrants"}]
POSTED BY: Patrick Scheibe
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract