我需要使用三次样条在 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)
我的情节仍然没有顺利,也许我错过了一些东西,请帮我解决这个问题。我的绘图输出是这样的: