Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Seaborn : How to get the count in y axis for distplot using PairGrid

Tags:

python

seaborn

I'm using PairGrid but I don't understand what does y axis means for distplot. I thought it represents a count. But it's starting from negative values in the pairgrid. If I make only the distplot, I'm getting the count.

I don't know if it's clear so, there's some plots :

My PairGrid:

My PairGrid

My distplot :

Distplot

The distplot is the same as the plot in the top left corner of the PairGrid.

The code corresponding to this is :

sns.distplot(pd.DataFrame(mySerie), kde=False)

and for the PairGrid :

g = sns.PairGrid(myDataFrame)
g = g.map_diag(sns.distplot, kde=False)
g = g.map_offdiag(plt.scatter)

Thank you in advance

like image 652
AMTheMonkey Avatar asked Oct 27 '25 09:10

AMTheMonkey


1 Answers

You can use both methods to see a different trend in the data in respect to the range of values and the total count. See below to get a better idea on what I was working for when I came across your question, (sorry not sharing data itself that is too big). with KDE false I can see that the amount of Yes is twice as much as No in the total count. Instead with KDE True I can see that at lower ranges of values the No is predominant and even higher in % over the Yes category. Hope it will help...

kde=False

kde=False

kde=True

kde=True

like image 112
PDMKDZ Avatar answered Oct 28 '25 23:10

PDMKDZ