1.使用下面可以使得图像独立显示,
import matplotlib.pyplot as plt
matplotlib.use('TkAgg')
则会独立显示:
去掉则不独立显示
2.图像的显示
plt.plot(x_points,real_func(x_points),label='real')
plt.plot(x_points,fit_func(p_lsp[0],x_points),label='fitted curve')
plt.plot(x,y,'bo',label='noise')
不会对图像进行显示 图像显示 应该增加 :
plt.show()