Seaborn:如何使用 PairGrid 获取 distplot 的 y 轴计数 [英] Seaborn : How to get the count in y axis for distplot using PairGrid

查看:48
本文介绍了Seaborn:如何使用 PairGrid 获取 distplot 的 y 轴计数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 PairGrid,但我不明白 y 轴对于 distplot 意味着什么.我认为它代表一个计数.但它是从pairgrid 中的负值开始的.如果我只制作 distplot,我就会得到计数.

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 :

我的配对网格:

我的分布图:

distplot 与 PairGrid 左上角的绘图相同.

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

对应的代码是:

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

和 PairGrid :

and for the PairGrid :

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

提前致谢

推荐答案

您可以使用这两种方法来查看数据在值范围和总计数方面的不同趋势.当我遇到您的问题时,请参阅下文以更好地了解我的工作目的(抱歉没有共享太大的数据本身).使用 KDE false 我可以看到 Yes 的数量是 No 总数的两倍.相反,使用 KDE True 我可以看到,在较低的值范围内,No 占主导地位,并且在 Yes 类别中的百分比更高.希望它会有所帮助...

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

这篇关于Seaborn:如何使用 PairGrid 获取 distplot 的 y 轴计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆