0

I am currently plotting 3 kernel density estimations together on the same graph. I assume that kdeplots use relative frequency as the y value, however for some of my data the kdeplot has frequencies way above 1.

code I'm using:

sns.distplot(data1, kde_kws={"color": "b", "lw": 1.5, "shade": "False",  "kernel": "gau", "label": "t"}, hist=False)

Does anyone know how I can make sure that the kdeplot either makes y value relative frequency, or allow me to adjust the ymax axis limit automatically to the maximum frequency calculated?

Charlietrypsin
  • 107
  • 1
  • 15
  • The y axis for a KDE plot is density, not relative frequency. There are numerous good examples of the distinction, e.g. here: http://stats.stackexchange.com/questions/138484/displaying-frequency-when-using-kernel-density-estimation – mwaskom Mar 21 '15 at 20:41
  • Ah okay that explains the axis. Do you know how I could set the ymax tovalue be the maximum density of the data then? – Charlietrypsin Mar 22 '15 at 14:57

1 Answers1

2

Okay so I figured out that I just needed to set the autocaling to Tight, that way it didn't give negative values on the scale.

Charlietrypsin
  • 107
  • 1
  • 15