UpSetPlot icon indicating copy to clipboard operation
UpSetPlot copied to clipboard

Support for multisets?

Open chris-rands opened this issue 4 years ago • 4 comments

I would like to generate a plot with non-unique values, so it can't be represented in a set, but could be represented in say a multi-set like acollections.Counter() object. Could this be supported? Thanks

chris-rands avatar May 04 '21 14:05 chris-rands

The plot is designed to support a many-to-many relationship between items and categories. The set intersections depicted represent the subset of items present in and only in a group of categories indicated by the dots.

How does this notion of multiple categories differ from your use case?

jnothman avatar May 04 '21 14:05 jnothman

Thanks. Maybe I'm not explaining myself well, I would like this to work:upsetplot.from_contents({"A": [1,2,1], "B": [1,3,4]}), which raises: ValueError: Got duplicate ids in a category. (In the same way that venn diagrams can support Counters() like in https://pypi.org/project/matplotlib-venn/) Does it make sense?

chris-rands avatar May 04 '21 15:05 chris-rands

Hi @chris-rands, trying to understand your request again. What do you expect the difference to be between, say:

upsetplot.plot(upsetplot.from_contents({"A": [1,2,0], "B": [1,3,4]}))

and

upsetplot.plot(upsetplot.from_contents({"A": [1,2,1], "B": [1,3,4]}))

Currently from_contents treats the set of values as unique identifiers, which may then be used to join into the data parameter.

jnothman avatar Jun 06 '21 15:06 jnothman

@chris-rands, could you please explain how to interpret your proposed usage?

jnothman avatar Jul 29 '21 02:07 jnothman