[SciPy-User] Interpolation problem with interp1d(.)

eat e.antero.tammi@gmail....
Wed Aug 29 14:29:18 CDT 2012


Hi,

Apparently I'm somehow misusing the functionality of  interp1d(.) or does
following behavior imply a bug in scipy. A minimum snippet (with plots) to
demonstrate the problem:
In []: from scipy.interpolate import interp1d
In []: n= 1000
In []: x, y= randn(n), linspace(0, 1, n)
In []: x.sort()
In []: plot(x, y, lw= 2)
Out[]: [<matplotlib.lines.Line2D object at 0x12E190D0>]

In []: f= interp1d(x, y, 'cubic')
In []: xi= linspace(x.min(), x.max(), n)
In []: plot(xi, f(xi))
Out[]: [<matplotlib.lines.Line2D object at 0x12E20830>]

Regards,
-eat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20120829/bdfc0bbb/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p0.png
Type: image/png
Size: 34991 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/scipy-user/attachments/20120829/bdfc0bbb/attachment-0003.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p1.png
Type: image/png
Size: 37514 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/scipy-user/attachments/20120829/bdfc0bbb/attachment-0004.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p2.png
Type: image/png
Size: 54543 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/scipy-user/attachments/20120829/bdfc0bbb/attachment-0005.png 


More information about the SciPy-User mailing list