This is documentation for an old release of SciPy (version 0.9.0). Read this page in the documentation of the latest stable release (version 1.15.1).
Interpolate a 1D function.
This class returns a function whose call method uses linear interpolation to find the value of new points.
Parameters : | x : array_like
y : array_like
kind : str or int, optional
axis : int, optional
copy : bool, optional
bounds_error : bool, optional
fill_value : float, optional
|
---|
Examples
>>> import scipy.interpolate
>>> x = np.arange(0, 10)
>>> y = np.exp(-x/3.0)
>>> f = sp.interpolate.interp1d(x, y)
>>> xnew = np.arange(0,9, 0.1)
>>> ynew = f(xnew)
>>> plt.plot(x, y, 'o', xnew, ynew, '-')