【发布时间】:2019-03-11 19:10:43
【问题描述】:
我有两个数据数组,我使用 pyplot 为其绘制直方图:
data1 = numpyArray1
data2 = numpyArray2
它们的大小不同,所以我使用选项density=True 来正确比较它们。我还让 pyplot 自动选择 bin,因为数据是浮动的,我不会(除非绝对必要)自动创建限制。
fig, ax = plt.subplots(....)
ax[...].hist([data1, data2], bins = 30, density = True, histtype='step)
例子:
问题:
- 我可以假设两个分布的 bin 完全相同吗?
- 如何查看(甚至更好地获取)pyplot 创建的自动 bin 限制? (This question assumes the bins are integer numbers, not valid for me)
- (可选)我能以某种方式获得两条曲线的交点吗? (This question assumes gaussian distribution, which doesn't solve my problem)
【问题讨论】:
-
在上面的代码中,您传递了 30 个垃圾箱。根据this 链接,bins 的默认值为 10。
标签: python numpy matplotlib