{"id":24794,"library":"upsetplot","title":"UpSetPlot","description":"A Python library to draw Lex et al.'s UpSet plots using Pandas and Matplotlib. Current version is 0.9.0, with occasional releases.","status":"active","version":"0.9.0","language":"python","source_language":"en","source_url":"https://github.com/jnothman/UpSetPlot","tags":["visualization","upset","sets","matplotlib","pandas"],"install":[{"cmd":"pip install upsetplot","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Data input for sets","package":"pandas","optional":false},{"reason":"Plotting backend","package":"matplotlib","optional":false}],"imports":[{"note":"Common mistake: importing the module without the UpSet class. Correct pattern is `from upsetplot import UpSet`.","wrong":"import upsetplot as up","symbol":"from upsetplot import UpSet","correct":"from upsetplot import UpSet"},{"note":"`from_indicators` was removed in version 0.8.0; use `from_memberships` instead.","wrong":"from upsetplot import from_indicators","symbol":"from upsetplot import from_memberships","correct":"from upsetplot import from_memberships"}],"quickstart":{"code":"import pandas as pd\nfrom upsetplot import UpSet\n\ndata = {\n    'ID': [1,2,3,4,5],\n    'Set1': [True, True, False, False, True],\n    'Set2': [False, True, True, False, False],\n    'Set3': [True, False, True, True, False]\n}\ndf = pd.DataFrame(data)\n# Convert to indicator format (each row one set?): Actually upsetplot expects memberships\nmemberships = [\n    ['Set1', 'Set3'],\n    ['Set1', 'Set2'],\n    ['Set2', 'Set3'],\n    ['Set3'],\n    ['Set1']\n]\nfrom upsetplot import from_memberships\nupset_data = from_memberships(memberships, data=df['ID'])\nplot = UpSet(upset_data, subset_size='count')\nplot.plot()\nimport matplotlib.pyplot as plt\nplt.show()","lang":"python","description":"Create a basic UpSet plot from membership lists. Uses `from_memberships` to convert data, then `UpSet().plot()`."},"warnings":[{"fix":"Replace `from_indicators(membership_matrix)` with `from_memberships(membership_lists)`.","message":"`from_indicators` was removed in version 0.8.0. Use `from_memberships` or `from_abundance` instead.","severity":"breaking","affected_versions":">=0.8.0"},{"fix":"Change `sort_by='degree'` to `sort_by='cardinality'`.","message":"The `UpSet` class parameter `sort_by` with value 'degree' is deprecated; use 'cardinality'.","severity":"deprecated","affected_versions":">=0.6.0"},{"fix":"Add `import matplotlib.pyplot as plt; plt.show()` after `plot.plot()`.","message":"When using `UpSet.plot()`, call `plt.show()` explicitly; otherwise the plot may not display in scripts.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure `data` length matches the number of elements (rows) in the membership lists.","message":"The `data` parameter in `from_memberships` must be a pandas Series or array of the same length as the membership list.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use `from upsetplot import from_memberships` and convert your indicator matrix to membership lists.","cause":"`from_indicators` was removed in version 0.8.0.","error":"AttributeError: module 'upsetplot' has no attribute 'from_indicators'"},{"fix":"Change `sort_by='degree'` to `sort_by='cardinality'`.","cause":"The `sort_by` parameter no longer accepts 'degree' since version 0.6.0; use 'cardinality'.","error":"ValueError: 'degree' is not a valid value for sort_by"},{"fix":"Ensure you have upsetplot>=0.6.0 installed: `pip install -U upsetplot`. Use `from upsetplot import UpSet`.","cause":"Older versions of upsetplot (<0.6.0) had the UpSet class in a submodule or different name. Or you have a different library installed.","error":"ImportError: cannot import name 'UpSet' from 'upsetplot'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}