Matplotlib直方图不显示y轴上的概率密度

2024-06-06 11:21:03 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一组log10(LR)数据,我想在直方图中显示其分布。你知道吗

我使用来自matplotlibplt.hist来表示数据。你知道吗

但是,它显示的y轴最大为3.5,我不知道为什么。你知道吗

bins = np.linspace(-2, 3, 30)
plt.hist (y, bins, label=['M', 'CNM'], density= True, align= 'mid')
plt.title('Calibrated Likelihood Ratio for 6 minutiae')
plt.xlabel('log10(LRk)')
plt.legend(loc = 'upper right')
plt.show()

Output of the code

我已经包括了代码输出的图像。 我想知道我在这个情节中遗漏了什么,提前谢谢。你知道吗


Tags: 数据truematplotlibnpplt直方图densityhist