question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

displot(kind='ecdf',..., log_scale=True) not working

See original GitHub issue

The following line of code gives an error:

sns.displot(kind='ecdf', data=df, x='col_1', log_scale=True)

UserWarning: Data has no positive values, and therefore cannot be log-scaled.

My data is all positive and kind=‘hist’ or ‘kde’ works just fine.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
JanHomanncommented, Mar 11, 2021

Actually, I think there is a bigger problem. Even with the numbers that are bigger it doesn’t give a reasonable cumulative distribution.

Have a look at this:

sns.displot(kind='ecdf',x=np.random.lognormal(mean=-1,sigma=1,size=1000), log_scale=True);

sns.displot(kind='hist',x=np.random.lognormal(mean=-1,sigma=1,size=1000),
            log_scale=True, cumulative=True,
            element='step', bins=1000);

I think those plots should end up roughly the same. The upper plot is definitely wrong.

image

1reaction
mwaskomcommented, Mar 11, 2021

Indeed, though fortunately the result ends up being fairly obviously wrong visually, as you discovered.

Read more comments on GitHub >

github_iconTop Results From Across the Web

seaborn's displot: two edcf, 1 figure [duplicate] - Stack Overflow
Strange problem with getting unique output in bash.
Read more >
seaborn.displot — seaborn 0.12.1 documentation - PyData |
Either a pair of values that set the normalization range in data units or an object that will map from data units into...
Read more >
Plotting with seaborn | by keshav | Analytics Vidhya - Medium
Displot. This function provides access to several approaches for visualizing the univariate or bivariate distribution of data, ...
Read more >
Seaborn Version 0.11.0 is here with displot, histplot and ecdfplot
Let us make ecdf plot using displot() using kind=”ecdf”. Here we make ecdf plot of a variable and color it based on values...
Read more >
[seaborn Basic]displot usage - Kaggle
(with kind="ecdf"; univariate-only). Additionally, a ... sns.displot(data=penguins, x="flipper_length_mm", kind="ecdf"). Out[6]:. <seaborn.axisgrid.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found