简体   繁体   中英

Seaborn: Remove fit from distplot

I'm trying to plot a distribution with distplot(), and I want

  1. absolute numbers instead of relative frequency on the y axis
  2. no fitted function

I thought that (1) could be achieved by setting norm_hist=False , but still, relative frequencies are shown on the y axis:

第一次尝试

But no problem, I can work around that by directly setting the 'normed' keyword of the underlying pyplot.hist graph:

第二次尝试

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. 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.

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).

To get rid of the kde curve, you may use the kde=False keyword argument.

distplot( ... , kde=False)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM