{"id":15628255,"url":"https://github.com/jnothman/upsetplot","last_synced_at":"2025-05-16T08:06:43.725Z","repository":{"id":29658442,"uuid":"122333034","full_name":"jnothman/UpSetPlot","owner":"jnothman","description":"Draw UpSet plots with Matplotlib","archived":false,"fork":false,"pushed_at":"2024-05-02T09:46:52.000Z","size":1751,"stargazers_count":351,"open_issues_count":54,"forks_count":69,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-16T08:06:36.346Z","etag":null,"topics":["data-visualization","matplotlib","python"],"latest_commit_sha":null,"homepage":"http://upsetplot.rtfd.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jnothman.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-21T12:23:00.000Z","updated_at":"2025-05-07T15:43:21.000Z","dependencies_parsed_at":"2023-01-14T15:24:01.972Z","dependency_job_id":"e2b8922a-6495-424e-9054-dbb63b1bc70c","html_url":"https://github.com/jnothman/UpSetPlot","commit_stats":{"total_commits":232,"total_committers":11,"mean_commits":21.09090909090909,"dds":0.05603448275862066,"last_synced_commit":"3f6b2e7452e25194bbc5286009ba5b18eabf1072"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnothman%2FUpSetPlot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnothman%2FUpSetPlot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnothman%2FUpSetPlot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnothman%2FUpSetPlot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jnothman","download_url":"https://codeload.github.com/jnothman/UpSetPlot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254493385,"owners_count":22080127,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-visualization","matplotlib","python"],"created_at":"2024-10-03T10:21:41.365Z","updated_at":"2025-05-16T08:06:38.717Z","avatar_url":"https://github.com/jnothman.png","language":"Python","readme":"UpSetPlot documentation\n============================\n\n|version| |licence| |py-versions|\n\n|issues| |build| |docs| |coverage|\n\nThis is another Python implementation of UpSet plots by Lex et al. [Lex2014]_.\nUpSet plots are used to visualise set overlaps; like Venn diagrams but\nmore readable. Documentation is at https://upsetplot.readthedocs.io.\n\nThis ``upsetplot`` library tries to provide a simple interface backed by an\nextensible, object-oriented design.\n\nThere are many ways to represent the categorisation of data, as covered in\nour `Data Format Guide \u003chttps://upsetplot.readthedocs.io/en/stable/formats.html\u003e`_.\n\nOur internal input format uses a `pandas.Series` containing counts\ncorresponding to subset sizes, where each subset is an intersection of named\ncategories.  The index of the Series indicates which rows pertain to which\ncategories, by having multiple boolean indices, like ``example`` in the\nfollowing::\n\n    \u003e\u003e\u003e from upsetplot import generate_counts\n    \u003e\u003e\u003e example = generate_counts()\n    \u003e\u003e\u003e example\n    cat0   cat1   cat2\n    False  False  False      56\n                  True      283\n           True   False    1279\n                  True     5882\n    True   False  False      24\n                  True       90\n           True   False     429\n                  True     1957\n    Name: value, dtype: int64\n\nThen::\n\n    \u003e\u003e\u003e from upsetplot import plot\n    \u003e\u003e\u003e plot(example)  # doctest: +SKIP\n    \u003e\u003e\u003e from matplotlib import pyplot\n    \u003e\u003e\u003e pyplot.show()  # doctest: +SKIP\n\nmakes:\n\n.. image:: http://upsetplot.readthedocs.io/en/latest/_images/sphx_glr_plot_generated_001.png\n   :target: ../auto_examples/plot_generated.html\n\nAnd you can save the image in various formats::\n\n    \u003e\u003e\u003e pyplot.savefig(\"/path/to/myplot.pdf\")  # doctest: +SKIP\n    \u003e\u003e\u003e pyplot.savefig(\"/path/to/myplot.png\")  # doctest: +SKIP\n\nThis plot shows the cardinality of every category combination seen in our data.\nThe leftmost column counts items absent from any category. The next three\ncolumns count items only in ``cat1``, ``cat2`` and ``cat3`` respectively, with\nfollowing columns showing cardinalities for items in each combination of\nexactly two named sets. The rightmost column counts items in all three sets.\n\nRotation\n........\n\nWe call the above plot style \"horizontal\" because the category intersections\nare presented from left to right.  `Vertical plots\n\u003chttp://upsetplot.readthedocs.io/en/latest/auto_examples/plot_vertical.html\u003e`__\nare also supported!\n\n.. image:: http://upsetplot.readthedocs.io/en/latest/_images/sphx_glr_plot_vertical_001.png\n   :target: http://upsetplot.readthedocs.io/en/latest/auto_examples/plot_vertical.html\n\nDistributions\n.............\n\nProviding a DataFrame rather than a Series as input allows us to expressively\n`plot the distribution of variables\n\u003chttp://upsetplot.readthedocs.io/en/latest/auto_examples/plot_diabetes.html\u003e`__\nin each subset.\n\n.. image:: http://upsetplot.readthedocs.io/en/latest/_images/sphx_glr_plot_diabetes_001.png\n   :target: http://upsetplot.readthedocs.io/en/latest/auto_examples/plot_diabetes.html\n\nLoading datasets\n................\n\nWhile the dataset above is randomly generated, you can prepare your own dataset\nfor input to upsetplot.  A helpful tool is `from_memberships`, which allows\nus to reconstruct the example above by indicating each data point's category\nmembership::\n\n    \u003e\u003e\u003e from upsetplot import from_memberships\n    \u003e\u003e\u003e example = from_memberships(\n    ...     [[],\n    ...      ['cat2'],\n    ...      ['cat1'],\n    ...      ['cat1', 'cat2'],\n    ...      ['cat0'],\n    ...      ['cat0', 'cat2'],\n    ...      ['cat0', 'cat1'],\n    ...      ['cat0', 'cat1', 'cat2'],\n    ...      ],\n    ...      data=[56, 283, 1279, 5882, 24, 90, 429, 1957]\n    ... )\n    \u003e\u003e\u003e example\n    cat0   cat1   cat2\n    False  False  False      56\n                  True      283\n           True   False    1279\n                  True     5882\n    True   False  False      24\n                  True       90\n           True   False     429\n                  True     1957\n    dtype: int64\n\nSee also `from_contents`, another way to describe categorised data, and\n`from_indicators` which allows each category to be indicated by a column in\nthe data frame (or a function of the column's data such as whether it is a\nmissing value).\n\nInstallation\n------------\n\nTo install the library, you can use `pip`::\n\n    $ pip install upsetplot\n\nInstallation requires:\n\n* pandas\n* matplotlib \u003e= 2.0\n* seaborn to use `UpSet.add_catplot`\n\nIt should then be possible to::\n\n    \u003e\u003e\u003e import upsetplot\n\nin Python.\n\nWhy an alternative to py-upset?\n-------------------------------\n\nProbably for petty reasons. It appeared `py-upset\n\u003chttps://github.com/ImSoErgodic/py-upset\u003e`_ was not being maintained.  Its\ninput format was undocumented, inefficient and, IMO, inappropriate.  It did not\nfacilitate showing plots of each subset's distribution as in Lex et al's work\nintroducing UpSet plots. Nor did it include the horizontal bar plots\nillustrated there. It did not support Python 2. I decided it would be easier to\nconstruct a cleaner version than to fix it.\n\nReferences\n----------\n\n.. [Lex2014] Alexander Lex, Nils Gehlenborg, Hendrik Strobelt, Romain Vuillemot, Hanspeter Pfister,\n   *UpSet: Visualization of Intersecting Sets*,\n   IEEE Transactions on Visualization and Computer Graphics (InfoVis '14), vol. 20, no. 12, pp. 1983–1992, 2014.\n   doi: `doi.org/10.1109/TVCG.2014.2346248 \u003chttps://doi.org/10.1109/TVCG.2014.2346248\u003e`_\n\n\n.. |py-versions| image:: https://img.shields.io/pypi/pyversions/upsetplot.svg\n    :alt: Python versions supported\n\n.. |version| image:: https://badge.fury.io/py/UpSetPlot.svg\n    :alt: Latest version on PyPi\n    :target: https://badge.fury.io/py/UpSetPlot\n\n.. |build| image:: https://github.com/jnothman/upsetplot/actions/workflows/test.yml/badge.svg\n    :alt: Github Workflows CI build status\n    :scale: 100%\n    :target: https://github.com/jnothman/UpSetPlot/actions/workflows/test.yml\n\n.. |issues| image:: https://img.shields.io/github/issues/jnothman/UpSetPlot.svg\n    :alt: Issue tracker\n    :target: https://github.com/jnothman/UpSetPlot\n\n.. |coverage| image:: https://coveralls.io/repos/github/jnothman/UpSetPlot/badge.svg\n    :alt: Test coverage\n    :target: https://coveralls.io/github/jnothman/UpSetPlot\n\n.. |docs| image:: https://readthedocs.org/projects/upsetplot/badge/?version=latest\n     :alt: Documentation Status\n     :scale: 100%\n     :target: https://upsetplot.readthedocs.io/en/latest/?badge=latest\n\n.. |licence| image:: https://img.shields.io/badge/Licence-BSD-blue.svg\n     :target: https://opensource.org/licenses/BSD-3-Clause\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjnothman%2Fupsetplot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjnothman%2Fupsetplot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjnothman%2Fupsetplot/lists"}