def gauss(x, a, x0, sigma):
return a*np.exp(-(x-x0)2/(2*sigma2))
plt.figure(figsize=(20,10))
plt.hist(volval1,bins=10, range=(3000,4000),alpha=0.5,histtype='bar',rwidth=1)
plt.xlim(left=3000,right=4000)
yerror=np.sqrt(b)
plt.errorbar(a,b,yerr=yerror,fmt='o')
popt,pcov = curve_fit(gauss,volval1,val_count,p0=[100,3400,140])
j=np.arange(3000,4000)
plt.plot(j,gauss(j,*popt),label='fit')
plt.legend()
那个绿色的curve_fit是哪里有错吗?想要达到下图这样
你好,我是有问必答小助手,非常抱歉,本次您提出的有问必答问题,技术专家团超时未为您做出解答
本次提问扣除的有问必答次数,已经为您补发到账户,我们后续会持续优化,扩大我们的服务范围,为您带来更好地服务。