如何解释Seaborn distplot的轴 [英] How to interpret Seaborn distplot's axes

查看:1194
本文介绍了如何解释Seaborn distplot的轴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

摘要:

plt.figure(figsize=(10,5))
plt.xticks(np.arange(0, 11, 1))
sns.distplot([1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10], kde=False)

输出:

x轴和y轴是什么?

我认为x代表每个bin的边界,y是落入bin中的出现次数,但y轴上的值似乎不正确

I thought x represents the boundary of each bin and y is the number of occurrence that falls into the bin, but the values on the y-axis does not seem correct

更新:感谢@tryptofan,如果执行以下命令,则会生成相同的图形:

Update: thanks to @tryptofan, if the following command is execute, the same graph is produced:

sns.distplot([1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10], kde=False, bins=3)

Seaborn不返回任何bin信息+我所做的自定义xtick plt.xticks(np.arange(0, 11, 1))这一事实使此图表非常混乱.

The fact that Seaborn does not return any bin info + the custom xtick I did plt.xticks(np.arange(0, 11, 1)) made this chart really confusing.

推荐答案

输出distplot中的间隔单位为3,因此您计算6次出现在1到4之间的值,8次出现在4到7之间的值.以及6个出现在7到10之间的值.

The intervalle unit in the distplot of your output is 3, so you count 6 occurrences of values between 1 and 4, 8 occurrences of values between 4 and 7, and 6 occurrences of values between 7 and 10.

这篇关于如何解释Seaborn distplot的轴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆