Specify maximum number of intersections to display
Hi,
Apologies if this has already been implemented, but after going through the API documentation, I'm unable to find an option that limits the number of displayed intersections, which forces me to manually truncate my dataframe I'm trying to plot from.
If you can point me to an argument that lets me do this that would be great. If this is not already implemented, it certainly would be useful!
Thanks!
min_subset_size, max_subset_size, min_degree and max_degree control the number of displayed intersections, but perhaps not in the way you want it parametrised, which sounds like max_n_subsets
Gotcha. I think there would be utility in implementing such an option that would (hopefully) not be terribly difficult to do. Thanks!
For anyone that wants to filter on e.g. the 10 largest intersections:
import numpy as np
from upsetplot import from_contents, from_memberships, from_indicators, plot
content = from_contents(data)
uniques, counts = np.unique(content.index, return_counts=True)
sorted_uniques = [x for _, x in sorted(zip(counts, uniques), reverse=True)]
plot(content.loc[sorted_uniques[:10]], sort_by=None)
For anyone that wants to filter on e.g. the 10 largest intersections
Note that this will get the per-category totals wrong.
Adding the max_subset_rank parameter in #253, which is inclusive in the case of ties.