[英]Seaborn: Remove fit from distplot
I'm trying to plot a distribution with distplot(), and I want 我正在尝试使用distplot()绘制分布,我想要
I thought that (1) could be achieved by setting norm_hist=False
, but still, relative frequencies are shown on the y axis: 我认为(1)可以通过设置
norm_hist=False
来实现,但是仍然在y轴上显示相对频率:
But no problem, I can work around that by directly setting the 'normed' keyword of the underlying pyplot.hist graph: 但没问题,我可以通过直接设置底层pyplot.hist图的'normed'关键字来解决这个问题:
However, now I have the problem that the fitted function (created with pyplot.plot) still works on the normalized values and thus is somewhere on the bottom of the graph. 但是,现在我遇到的问题是拟合函数(用pyplot.plot创建)仍然适用于规范化的值,因此位于图的底部。 I would like to completely get rid of the fitted plot.
我想完全摆脱合适的情节。 How do I do that?
我怎么做? I thought setting
fit=None
would do the trick, but as you can see, it doesn't. 我认为设置
fit=None
会成功,但正如你所看到的,它没有。
Any help is appreciated! 任何帮助表示赞赏!
Lukas 卢卡斯
The line you call "fit" is a kernel density estimate (KDE), it only makes sense for a normalized plot (as it is a probability density function). 你称之为“拟合”的线是核密度估计(KDE),它只对标准化图(因为它是概率密度函数)有意义。
To get rid of the kde curve, you may use the kde=False
keyword argument. 要摆脱kde曲线,可以使用
kde=False
关键字参数。
distplot( ... , kde=False)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.