What is y axis in seaborn distplot?

后端 未结 2 835
孤城傲影
孤城傲影 2020-12-13 01:45

I have some geometrically distributed data. When I want to take a look at it, I use

sns.distplot(data, kde=False, norm_hist=True, bins=100)

相关标签:
2条回答
  • 2020-12-13 02:06

    The x-axis is the value of the variable just like in a histogram, but what exactly does the y-axis represent?

    ANS-> The y-axis in a density plot is the probability density function for the kernel density estimation. However, we need to be careful to specify this is a probability density and not a probability. The difference is the probability density is the probability per unit on the x-axis. To convert to an actual probability, we need to find the area under the curve for a specific interval on the x-axis. Somewhat confusingly, because this is a probability density and not a probability, the y-axis can take values greater than one. The only requirement of the density plot is that the total area under the curve integrates to one. I generally tend to think of the y-axis on a density plot as a value only for relative comparisons between different categories.

    from the reference of https://towardsdatascience.com/histograms-and-density-plots-in-python-f6bda88f5ac0

    0 讨论(0)
  • 2020-12-13 02:27

    From the documentation:

    norm_hist : bool, optional

    If True, the histogram height shows a density rather than a count. This is implied if a KDE or fitted density is plotted.

    So you need to take into account your bin width as well, i.e. compute the area under the curve and not just the sum of the bin heights.

    0 讨论(0)
提交回复
热议问题