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

show_percentages doesn't sum to 100% #101

Closed
eburling opened this issue Sep 10, 2020 · 4 comments · Fixed by #103
Closed

show_percentages doesn't sum to 100% #101

eburling opened this issue Sep 10, 2020 · 4 comments · Fixed by #103

Comments

@eburling
Copy link

eburling commented Sep 10, 2020

I noticed that the percentages above the intersection bars do not sum to 100%. Shouldn't the displayed percentages represent the contribution of each intersection to the whole dataset, and so all percentages sum t 100%?

If I run this block using upsetplot 0.4.0:

from matplotlib import pyplot as plt
from upsetplot import generate_counts, plot

example = generate_counts()

plot(example, show_counts='%d', show_percentages=True)
plt.suptitle('With counts and percentages shown')
plt.show()

I get the following output:
image
Category bar percentages sum to 100%, but not intersection bar percentages.

Any thoughts on this?

Thanks!

@jnothman
Copy link
Owner

jnothman commented Sep 10, 2020 via email

@jnothman
Copy link
Owner

My initial reply didn't send:
Yes, the percentages are wrong. Thanks for the report. The ones over the intersection bars should sum to one, and the ones on the category totals should sum to more than 100%.

@eburling
Copy link
Author

Thanks!

I'm now able to hack together these multi-category UpSet plots to visualize entropy across categories. Very nifty.

image

@mbuttner
Copy link

mbuttner commented Jul 3, 2023

Hi there,
I realized that the percentages on the categories don't sum up to 100% anymore, which is counterintuitive. To my mind, it would be great if one could control whether to show the percentages on the categories and the intersections separately. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants