Search code examples
pythonseaborncontourkernel-density

What does levels mean in seaborn kde plot?


I am trying to make a contour plot of my 2d data. However, I would like to input the contours manually. I found the "levels" option in seaborn.kde documentation, where I can define the levels for contours manually. However, I have no idea what these levels mean. The documentation gives this definition -

Levels correspond to iso-proportions of the density.

What does iso-proportions of density mean? Are there any references that I could read up on this?


Solution

  • Basically, the contour line for the level corresponding to 0.05 is drawn such that 5% of the distribution lies "below" it. Alternately, because the integral over the full density equals 1 (that's what makes it a PDF), the integral over the area outside of the contour line will be 0.05.