pythonmatplotlibseabornkernel-densityviolin-plot

inaccurate range of violin plots in seaborn


For some reasons, the range of the plot is not accurate. In my data there are no negative values.

enter image description here

When I set range to -100 to 100 there some portion of the distribution under 0 mark.

enter image description here


Solution

  • From the documentation:

    "As you can see above, the nature of the Gaussian KDE process means that estimation extends past the largest and smallest values in the dataset. It’s possible to control how far past the extreme values the curve is drawn with the cut parameter; however, this only influences how the curve is drawn and not how it is fit"