| Author |
Comment/Response |
Rob N
|
10/03/10 5:02pm
Hi,
I was using ListPlot to draw a smooth line through some data points. It works great. [see attached screenshot]. But I want to be able to work with the 1st and 2nd derivative of the plot, so I thought I'd create an actual "function" using Interpolation. But as you can see in the picture, it's not smooth. There are some strange spikes when I do Plot[Interpolation[...]...]. I'm wondering how ListPlot get's it's interpolated function, and how I can get the same thing, using Interpolation[] or some other method.
thank you,
Rob
ps. If my screenshot attachment doesn't work. Here are my inputs...
myPoints = {{0.,3.87},{1.21,4.05},{2.6,4.25},{4.62,4.48},{7.24,4.73},{9.66,4.93},{12.48,5.14},{14.87,5.33},{17.34,5.55},{19.31,5.78},{20.78,6.01},{22.08,6.34},{22.82,6.7},{23.2,7.06},{23.41,7.54},{23.52,8.78},{23.59,9.59},{23.62,9.93},{23.72,10.24},{23.88,10.56},{24.14,10.85},{24.46,11.05},{24.81,11.2},{25.73,11.44},{27.15,11.63}}
ListPlot[myPoints, Joined -> True, Mesh -> Full]
Plot[Interpolation[myPoints][x], {x, 0, 27.2}]
The last one has spikes.
The
Attachment: Screen shot 2010-10-03 at 5.56.41 PM.png, URL: , |
|