Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Distplot fix #473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
yankev merged 9 commits into master from distplot-fix
May 27, 2016
Merged

Distplot fix #473

yankev merged 9 commits into master from distplot-fix
May 27, 2016

Conversation

@yankev
Copy link
Contributor

@yankev yankev commented May 20, 2016

Copy link
Contributor Author

yankev commented May 20, 2016
edited
Loading

  • Going to include a keyword argument to swap between the new way (where histnorm = 'probability density'), and the original (histnorm = 'probability')
  • Need to add new tests for this functionality
empet reacted with thumbs up emoji

Copy link
Contributor Author

yankev commented May 25, 2016

@Kully @cldougl @theengineear @empet
Added an extra parameter called histnorm to deal with the two different types of distplots (the seaborn-like method/the original and probability density method)
I've kept the default for histnorm as probability for backwards compatibility.

plotly/tools.py Outdated
def create_distplot(hist_data, group_labels,
bin_size=1., curve_type='kde',
colors=[], rug_text=[],
colors=[], rug_text=[],histnorm='probability',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yankev can you add that param to the docstring as well (so around line 4039)

Copy link

empet commented May 25, 2016

@yankev The seaborn distplot is equivalent to plotly distplot corresponding to histnorm=probability density. Leaving the default as probability it's not a good idea because a lot of plots on Plotly cloud used wrong this key and people that take as examples these older plots can think that this version leads to a histogram comparable with an estimate of the probbaility density associated to data.

Copy link

empet commented May 26, 2016
edited
Loading

@yankev Here is the proof that seaborn distplot works like Plotly distplot with histnorm=probability density (see the last plot):http://nbviewer.jupyter.org/gist/empet/1bf38aea056f1d60481e600fc68c21be?flush_cache=true

Copy link
Contributor Author

yankev commented May 26, 2016

@empet oh I see, thanks. Initially I was trying to keep some backwards compatibility, but it appears as though setting histnorm = 'probability density' is the correct approach.

Copy link

empet commented May 26, 2016

@yankev Yes, this is the recommended default value for histnorm in distplot.

theengineear reacted with thumbs up emoji

plotly/tools.py Outdated
(self.curve_x[index]))
self.curve_y[index] *= self.bin_size[index]

if self.histnorm == 'probability':
Copy link
Contributor

@theengineear theengineear May 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you pull these into constants at the top of the file? Hard-coded things like this always raise 🚨's for me.

Copy link
Contributor

@yankev tests look great, thanks for adding those! 💃 me after pulling those histnorm values out into some constants somewhere!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /