Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/349.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
python中的平滑直方图_Python_Histogram_Seaborn_Bins - Fatal编程技术网

python中的平滑直方图

python中的平滑直方图,python,histogram,seaborn,bins,Python,Histogram,Seaborn,Bins,在我的程序中,我计算了三个参数的N个数量,并希望为每个参数创建三个直方图。我对直方图有严格的条件。首先,它是范围的一个条件(在某些点上直方图应该严格归零),并且应该是平滑的。 我使用np.直方图,如下所示: hist, bins = np.histogram(Gamm1, bins=100) center = bins[:-1] plt.plot(center, hist) plt.show() 但解决方案太尖锐了。在那之后,我对seaborn使用以下构造 snsplot = sns.kdep

在我的程序中,我计算了三个参数的N个数量,并希望为每个参数创建三个直方图。我对直方图有严格的条件。首先,它是范围的一个条件(在某些点上直方图应该严格归零),并且应该是平滑的。 我使用
np.直方图
,如下所示:

hist, bins = np.histogram(Gamm1, bins=100)
center = bins[:-1]
plt.plot(center, hist)
plt.show()
但解决方案太尖锐了。在那之后,我对
seaborn
使用以下构造

snsplot = sns.kdeplot(data['Third'], shade=True)
fig = snsplot.get_figure()
fig.savefig("output2.png")
但这里的近似值超出了范围(范围是根据物理条件创建的)

我认为为
seaborn
解决方案改变垃圾箱,就像为
np.histogram
做的那样,会有所帮助


但是,最后,我正在寻找一些解决方案,这些解决方案将是平滑的,并且在我给定的范围内。

我认为您正在寻找的是密度图,而不是直方图,因为它们根据定义是离散的:您完全正确!非常感谢你!