如何解释由 matplotlib.pyplot.hist 生成的相似值列表的概率密度函数的轴值?

问题描述 投票:0回答:0

我有一个包含 100000 个值的列表,所有值都在 299800 左右,如下所示。

values = [299850.3 299856.4 299855.9 ... 299843.7 299847.2 299860.9]

当我使用

matplotlib.pyplot.hist
绘制这些值的概率密度函数 (PDF) 时,我得到的图的 X 轴和 Y 轴值令人困惑。我希望 X 轴值在 299800 附近分箱,Y 轴值是这些分箱值发生的概率。如何正确解释这个图表值,感谢任何评论。

plt.hist(values,density=True, bins=30)
plt.xlabel("Values")
plt.ylabel('PDF')
plt.show()

python-3.x matplotlib statistics probability-density
© www.soinside.com 2019 - 2024. All rights reserved.