Seaborn: The function "distplot" maybe should support "log" parameter

Created on 12 Jun 2017  Â·  3Comments  Â·  Source: mwaskom/seaborn

When i want to draw a hist pic that y-axis value is log(value). I couldn't use distplot to complete it directly.

So i think maybe we can add parameter "log“ in the function distplot just like this

def distplot(......,log=False):
...
if hist:
...
ax.hist(...,log=True or False)
...
...

Most helpful comment

ax.set_yscale('log') is a good solution, but will fail for histogram bins with 0 count.
sns.distplot(..., hist_kws={'log':True}) does not, however.

All 3 comments

What kind of difficulities are you facing? What happens when you set y to log scale like below?

ax = sns.distplot(some_fancy_data)
ax.set_yscale('log')

use hist_kws

ax.set_yscale('log') is a good solution, but will fail for histogram bins with 0 count.
sns.distplot(..., hist_kws={'log':True}) does not, however.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TDaltonC picture TDaltonC  Â·  3Comments

alexpetralia picture alexpetralia  Â·  3Comments

amelio-vazquez-reina picture amelio-vazquez-reina  Â·  4Comments

songololo picture songololo  Â·  4Comments

dkoppstein picture dkoppstein  Â·  4Comments