做个笔记
代码
import matplotlib.pyplot as plt
import numpy as np
from scipy.interpolate import make_interp_spline
def smooth_curv(label_str,y):
x_array=np.arange(1,len(y)+1)
y_array=np.array(y)
x_smooth = np.linspace(x_array.min(), x_array.max(), 100)
y_smooth = make_interp_spline(x_array,y_array)(x_smooth)
plt.plot(x_smooth, y_smooth,label=label_str)



