三次样条曲线得到平滑的python线曲线

时间:2016-08-20 20:08:44

标签: python cubic-spline

我需要使用三次样条曲线在python中创建一条平滑线,我遵循scipy教程并且有点困惑。我使用了以下代码:

import matplotlib.pyplot as plt
from scipy import interpolate

tck = interpolate.splrep(time, ca40Mass)
plt.semilogy(time,ca40Mass,label='$^{40}$Ca')
plt.xlabel('time [s]')
plt.ylabel('fallback mass [$M_\odot$]')
plt.xlim(20,60)
plt.ylim(1.0e-3, 2.0e-1)
plt.legend(loc=3)

我的情节仍然没有顺利,也许我错过了什么,请帮我解决这个问题。我的情节输出是:

enter image description here

1 个答案:

答案 0 :(得分:2)

您没有使用插值。

table1(id, end_date)