[英]Y-axis of a seaborn distribution
I would like to change the y-axis of this plot.我想改变这个 plot 的 y 轴。 I don't know why I'm getting such low probabilities.我不知道为什么我得到这么低的概率。
The code I have is just:我的代码只是:
sns.distplot(df, kde=True);
And df is the following one: df 如下:
salaries
0 848
1 950
2 1577
3 963
4 1054
5 1013
6 985
7 1513
8 1021
9 895
10 983
11 1290
12 1043
13 881
14 924
15 1040
16 975
17 1183
18 1100
19 879
The height of a density function (which is what a histogram approximates) is not probability.密度 function(这是直方图的近似值)的高度不是概率。 Probabilities are found as the area under the density, and the total area must be 1. Given the range of your x-axis, you shouldn't be surprised that the heights along the y-axis are small—the average height should be about 1/800 (aka 0.00125) to yield an area of 1, which looks very much like what you're getting.概率是密度下的面积,总面积必须为 1。给定 x 轴的范围,沿 y 轴的高度很小,您不应该感到惊讶 - 平均高度应该约为1/800(又名 0.00125)产生 1 的面积,这看起来非常像你得到的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.