python根据坐标点拟合曲线绘图
import os
import numpy as np
from scipy import log
from scipy.optimize import curve_fit...curve_fit(func, x0, y0,method='trf')
a, b = result[0]
# 绘制拟合曲线用
x1 = np.arange(2, 48, 0.1)
#y1 =...plt.scatter(x0,y0,s=30,marker='o')
# 横纵坐标起止
plt.xlim((0, 50))
plt.ylim((0, round(max(y0))+2))
# 拟合曲线...plt.text(48, m, r'$R^2=$'+str(round(r2,3)), ha='right', va='top',fontsize=12)
# True 显示网格
# linestyle 设置线显示的类型...(一共四种)
# color 设置网格的颜色
# linewidth 设置网格的宽度
plt.grid(True, linestyle = "--", color = "g", linewidth