{
  "id": "upset-plot",
  "title": "UpSet Plot",
  "lang": "en",
  "source_lang": "en",
  "summary": "An UpSet plot visualizes intersections among multiple sets using a membership matrix and aligned bars that show the number of elements in each combination.",
  "category": "mathematics",
  "subcategory": "probability-statistics",
  "type": "concept",
  "aliases": [
    "UpSet chart",
    "UpSet diagram"
  ],
  "generated_at": "2026-11-06",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/upset-plot/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/upset-plot/",
      "json": "https://aiwiki.page/zh/upset-plot.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "An UpSet plot is a data visualization for comparing the sizes and composition of intersections among multiple sets. It represents combinations of set membership with a dot matrix and aligns each combination with a bar showing its size. Developed as an alternative to overlapping-region diagrams, it is particularly useful when the number of sets makes a Venn diagram difficult to read. The conventional display emphasizes exact membership combinations, distinguishing, for example, elements belonging to two specified sets only from elements belonging to those sets and additional ones."
    },
    {
      "heading": "Visual structure",
      "text": "A typical UpSet plot combines three coordinated components:\n\n- Membership matrix: Each row represents a set, and each column represents a membership combination. Filled or dark dots identify the sets included in that combination; pale dots or blank positions identify excluded sets.\n- Intersection-size bars: Bars aligned with the matrix columns show the number of elements in the corresponding combinations. In the common orientation, these bars appear above the matrix.\n- Set-size bars: An additional bar chart, usually beside the matrix, shows the total number of elements in each set.\n\nLines commonly connect the filled dots within a column to make the combination easier to follow. These lines do not represent a path, hierarchy, or relationship between individual elements.\n\nThe display may be rotated, with sets in columns and combinations in rows. Its defining feature is the alignment of membership patterns with quantitative bars, rather than any particular orientation.\n\nUnlike diagrams that encode quantities through overlapping areas, an UpSet plot uses bar lengths on a common scale. This makes differences in intersection size easier to compare, while separating the representation of membership from the representation of quantity."
    },
    {
      "heading": "Mathematical basis",
      "text": "Let \\(A_1,\\ldots,A_k\\) be sets contained in a finite universe \\(U\\). The membership of an element \\(x\\) can be described by a binary vector\n\n\\[b(x)=\\bigl(\\mathbf{1}_{A_1}(x),\\ldots,\\mathbf{1}_{A_k}(x)\\bigr),\\]\n\nwhere the indicator function \\(\\mathbf{1}_{A_i}(x)\\) equals 1 when \\(x\\in A_i\\) and 0 otherwise.\n\nFor an index set \\(S\\subseteq\\{1,\\ldots,k\\}\\), define the exact membership group\n\n\\[E_S= \\left(\\bigcap_{i\\in S}A_i\\right) \\cap \\left(\\bigcap_{j\\notin S}(U\\setminus A_j)\\right).\\]\n\nThis group contains elements belonging to every selected set and to none of the unselected sets. The corresponding bar usually represents its cardinality, \\(|E_S|\\).\n\nThe nonempty exact membership groups form a partition of the union of the displayed sets. Consequently,\n\n\\[\\left|\\bigcup_{i=1}^{k}A_i\\right| = \\sum_{\\varnothing\\ne S\\subseteq\\{1,\\ldots,k\\}}|E_S|.\\]\n\nThe total size of an individual set can be recovered by summing all exact groups that include it:\n\n\\[|A_i|=\\sum_{S:\\,i\\in S}|E_S|.\\]\n\nThis explains why a set-size bar generally differs from the bar for elements belonging to that set alone.\n\nExact and inclusive intersections\n\nAn inclusive intersection, such as \\(A_1\\cap A_2\\), includes elements that may also belong to other sets. An exact intersection excludes membership in every set not specified.\n\nFor three sets \\(A\\), \\(B\\), and \\(C\\),\n\n\\[A\\cap B= \\bigl((A\\cap B)\\setminus C\\bigr) \\;\\cup\\; (A\\cap B\\cap C),\\]\n\nwith the two groups on the right disjoint. Therefore,\n\n\\[|A\\cap B| = |(A\\cap B)\\setminus C| + |A\\cap B\\cap C|.\\]\n\nIn the conventional exact-intersection display, a column marking \\(A\\) and \\(B\\), but not \\(C\\), represents \\((A\\cap B)\\setminus C\\), not the entire inclusive intersection \\(A\\cap B\\).\n\nSome implementations support inclusive intersections, unions, or other queries. Their counts need not form a disjoint partition, so the interpretation must be specified in the plot labels or accompanying explanation."
    },
    {
      "heading": "Reading an example",
      "text": "Suppose three sets have the following exact membership counts:\n\nMembership combination | Number of elements\n\\(A\\) only | 12\n\\(B\\) only | 9\n\\(C\\) only | 7\n\\(A\\) and \\(B\\), but not \\(C\\) | 5\n\\(A\\) and \\(C\\), but not \\(B\\) | 3\n\\(B\\) and \\(C\\), but not \\(A\\) | 4\n\\(A\\), \\(B\\), and \\(C\\) | 2\n\nThe UpSet plot would have seven columns if all these combinations were displayed. The column with filled dots for \\(A\\) and \\(B\\) and an unfilled position for \\(C\\) would have a bar of height 5. The column marking all three sets would have a bar of height 2.\n\nThe set-size bars would show\n\n\\[|A|=22,\\qquad |B|=20,\\qquad |C|=16.\\]\n\nThe union contains 42 distinct elements, while the inclusive intersection \\(A\\cap B\\) contains \\(5+2=7\\) elements. Adding the three set sizes would count shared elements more than once."
    },
    {
      "heading": "Ordering, filtering, and attributes",
      "text": "UpSet plots commonly order combinations by:\n\n- Size: the number of elements in each group.\n- Degree: the number of sets included in a combination.\n- Membership pattern: an arrangement that places related combinations together.\n\nHere, degree means the number of participating sets; it does not measure the strength or significance of an association.\n\nThere are \\(2^k\\) possible binary membership patterns for \\(k\\) sets, including membership in none of them. Thus, up to \\(2^k-1\\) combinations occur within their union. This relationship follows from the size of the power set of the set indices. Many combinations may be empty, but the number of possible combinations still grows exponentially.\n\nImplementations therefore often omit zero-size groups, show only the largest intersections, or restrict the allowed degree. Filtering makes a display more manageable but changes what can be inferred from it: an omitted column may represent a hidden group rather than an empty one.\n\nExtended displays can associate intersections with element attributes, such as measurements, categories, or dates. Linked panels may show distributions within a selected intersection, while highlighting can identify elements satisfying a query. These features extend the chart from comparing counts to exploring the characteristics of overlapping groups."
    },
    {
      "heading": "History and implementations",
      "text": "UpSet was introduced in the 2014 paper UpSet: Visualization of Intersecting Sets by Alexander Lex, Nils Gehlenborg, Hendrik Strobelt, Romain Vuillemot, and Hanspeter Pfister. The original work presented an interactive visual-analysis approach combining set intersections, membership patterns, element attributes, and queries.\n\nThe name now also refers to static charts using its central matrix-and-bar design. Implementations include the R packages UpSetR and ComplexUpset, and the Python package UpSetPlot. Their filtering options, query features, layouts, and supported intersection semantics differ."
    },
    {
      "heading": "Applications and limitations",
      "text": "UpSet plots are used to compare overlapping lists, categories, and selection results. Applications include comparing gene lists from different experiments, examining shared detections across analysis methods, and displaying combinations of responses in multiple-choice surveys.\n\nTheir usefulness depends on how membership is defined. For example, converting continuous measurements into sets by applying thresholds can substantially change the observed overlaps. The plot displays the resulting membership structure, not the uncertainty or justification behind those thresholds.\n\nImportant limitations include:\n\n- Combinatorial growth: Many sets can produce too many nonempty combinations for a readable display.\n- Loss of individual detail: Count bars do not identify the elements in a group unless labels, tables, or interactive views provide that information.\n- Dependence on set selection: An exact intersection is defined relative to the displayed sets. Adding another set can split an existing group into smaller groups.\n- Universe dependence: Elements belonging to none of the sets are usually omitted. Their count requires a defined universe \\(U\\).\n- Limited statistical interpretation: A large overlap does not by itself establish statistical significance, similarity, or statistical dependence. Large sets may overlap substantially simply because they contain many elements.\n\nFor only two or three sets, a Venn diagram may communicate membership relationships more directly. UpSet plots are especially useful when accurate comparison of numerous intersection counts matters more than depicting overlaps as spatial regions."
    }
  ],
  "links": [
    "data-visualization",
    "set-mathematics",
    "venn-diagram",
    "indicator-function",
    "cardinality",
    "set-partition",
    "power-set",
    "gene",
    "statistical-independence"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}