Skip to content
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

Fix histplot/kdeplot normalization with weights #2812

Merged
merged 3 commits into from
May 18, 2022
Merged

Conversation

mwaskom
Copy link
Owner

@mwaskom mwaskom commented May 17, 2022

Fixes #2655

With the example from that issue:

f, axs = plt.subplots(2, 2, constrained_layout=True, figsize=(7, 6))
params = dict(x=[1, 2, 3], weights=[1, 2, 2], discrete=True)
sns.histplot(**params, ax=axs.flat[0])
sns.histplot(**params, hue=["a", "b", "b"], ax=axs.flat[1])
sns.histplot(**params, hue=["a", "b", "b"], stat="proportion", ax=axs.flat[2])
sns.histplot(**params, hue=["a", "b", "b"], stat="proportion", common_norm=False, ax=axs.flat[3])

image

@codecov
Copy link

codecov bot commented May 17, 2022

Codecov Report

Merging #2812 (603fa57) into master (0550195) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #2812   +/-   ##
=======================================
  Coverage   97.96%   97.96%           
=======================================
  Files          67       67           
  Lines       21719    21745   +26     
=======================================
+ Hits        21276    21302   +26     
  Misses        443      443           
Impacted Files Coverage Δ
seaborn/distributions.py 96.27% <100.00%> (+0.04%) ⬆️
seaborn/tests/test_distributions.py 99.79% <100.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0550195...603fa57. Read the comment docs.

@mwaskom mwaskom merged commit 60e58eb into master May 18, 2022
@mwaskom mwaskom deleted the fix/hist_weight_norm branch May 18, 2022 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

histplot common normalization ignores weights
2 participants