26 Sep
2006
26 Sep
'06
7:16 p.m.
Works for me using scipy 0.5.1.dev2185 on OS X. Michael. In article <be152e7d0609260527m5f178d2end1257e2216b49b8f@mail.gmail.com>, "Ewald Zietsman" <ewald.zietsman@gmail.com> wrote: ...
#! /usr/bin/python from scipy import interpolate from pylab import * x = arange(0.0,2.0*pi+pi/4.0,2.0*pi/8.0) y = sin(x) tck = interpolate.splrep(x,y,s=0.0) xnew = arange(0.0,2.0*pi+pi/4.0,pi/50.0) ynew = interpolate.splev(xnew,tck,der=0.0)
plot(x,y,'x') plot(xnew,ynew,'r-') show()
I should get a plot showing a sin curve made of blue x's and a smooth red line which is the spline...