相关疑难解决方法(0)

适合高斯函数

我有一个直方图(见下文),我试图找到平均值和标准偏差以及符合我的直方图曲线的代码.我认为SciPy或matplotlib中有一些东西可以提供帮助,但我尝试的每个例子都不起作用.

import matplotlib.pyplot as plt
import numpy as np

with open('gau_b_g_s.csv') as f:
    v = np.loadtxt(f, delimiter= ',', dtype="float", skiprows=1, usecols=None)

fig, ax = plt.subplots()

plt.hist(v, bins=500, color='#7F38EC', histtype='step')

plt.title("Gaussian")
plt.axis([-1, 2, 0, 20000])

plt.show()
Run Code Online (Sandbox Code Playgroud)

python matplotlib histogram curve-fitting scipy

25
推荐指数
2
解决办法
7万
查看次数

标签 统计

curve-fitting ×1

histogram ×1

matplotlib ×1

python ×1

scipy ×1