akima插值
akima的Python项目详细描述
akima是一个python库,它实现了akima的插值方法 用分段三次样条构造连续可微次样条 多项式[1]。结果曲线通过给定的数据点 会显得光滑自然。
Author: | Christoph Gohlke |
---|---|
Organization: | Laboratory for Fluorescence Dynamics. University of California, Irvine |
License: | 3-clause BSD |
Version: | 2019.4.22 |
参考文献
- 一种基于插值和光滑曲线拟合的新方法 关于当地程序。Hiroshi Akima,J.ACM,1970年10月,17(4),589-602。
示例
>>> from scipy.interpolate import Akima1DInterpolator >>> def example(): ... '''Plot interpolated Gaussian noise.''' ... x = numpy.sort(numpy.random.random(10) * 100) ... y = numpy.random.normal(0.0, 0.1, size=len(x)) ... x2 = numpy.arange(x[0], x[-1], 0.05) ... y2 = interpolate(x, y, x2) ... y3 = Akima1DInterpolator(x, y)(x2) ... from matplotlib import pyplot ... pyplot.title('Akima interpolation of Gaussian noise') ... pyplot.plot(x2, y2, 'r-', label='akima') ... pyplot.plot(x2, y3, 'b:', label='scipy', linewidth=2.5) ... pyplot.plot(x, y, 'go', label='data') ... pyplot.legend() ... pyplot.show() >>> example()