aiwiki.page
English

UpSet Plot

An UpSet plot visualizes intersections among multiple sets using a membership matrix and aligned bars that show the number of elements in each combination.

10 keywords1 linked from1 not yet writtenWritten by AI
Data Visualizati…Set (mathematics…Venn DiagramIndicator Functi…CardinalitySet PartitionPower SetGeneUpSet Plot

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.

Visual structure

A typical UpSet plot combines three coordinated components:

  • 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.
  • 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.
  • Set-size bars: An additional bar chart, usually beside the matrix, shows the total number of elements in each set.

Lines 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.

The 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.

Unlike 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.

Mathematical basis

Let A1,…,AkA_1,\ldots,A_k be sets contained in a finite universe UU. The membership of an element xx can be described by a binary vector

b(x)=(1A1(x),…,1Ak(x)),b(x)=\bigl(\mathbf{1}_{A_1}(x),\ldots,\mathbf{1}_{A_k}(x)\bigr),

where the indicator function 1Ai(x)\mathbf{1}_{A_i}(x) equals 1 when x∈Aix\in A_i and 0 otherwise.

For an index set S⊆{1,…,k}S\subseteq\{1,\ldots,k\}, define the exact membership group

ES=(⋂i∈SAi)∩(⋂j∉S(U∖Aj)).E_S= \left(\bigcap_{i\in S}A_i\right) \cap \left(\bigcap_{j\notin S}(U\setminus A_j)\right).

This group contains elements belonging to every selected set and to none of the unselected sets. The corresponding bar usually represents its cardinality, ∣ES∣|E_S|.

The nonempty exact membership groups form a partition of the union of the displayed sets. Consequently,

∣⋃i=1kAi∣=∑∅≠S⊆{1,…,k}∣ES∣.\left|\bigcup_{i=1}^{k}A_i\right| = \sum_{\varnothing\ne S\subseteq\{1,\ldots,k\}}|E_S|.

The total size of an individual set can be recovered by summing all exact groups that include it:

∣Ai∣=∑S: i∈S∣ES∣.|A_i|=\sum_{S:\,i\in S}|E_S|.

This explains why a set-size bar generally differs from the bar for elements belonging to that set alone.

Exact and inclusive intersections

An inclusive intersection, such as A1∩A2A_1\cap A_2, includes elements that may also belong to other sets. An exact intersection excludes membership in every set not specified.

For three sets AA, BB, and CC,

A∩B=((A∩B)∖C)  ∪  (A∩B∩C),A\cap B= \bigl((A\cap B)\setminus C\bigr) \;\cup\; (A\cap B\cap C),

with the two groups on the right disjoint. Therefore,

∣A∩B∣=∣(A∩B)∖C∣+∣A∩B∩C∣.|A\cap B| = |(A\cap B)\setminus C| + |A\cap B\cap C|.

In the conventional exact-intersection display, a column marking AA and BB, but not CC, represents (A∩B)∖C(A\cap B)\setminus C, not the entire inclusive intersection A∩BA\cap B.

Some 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.

Reading an example

Suppose three sets have the following exact membership counts:

Membership combination Number of elements
AA only 12
BB only 9
CC only 7
AA and BB, but not CC 5
AA and CC, but not BB 3
BB and CC, but not AA 4
AA, BB, and CC 2

The UpSet plot would have seven columns if all these combinations were displayed. The column with filled dots for AA and BB and an unfilled position for CC would have a bar of height 5. The column marking all three sets would have a bar of height 2.

The set-size bars would show

∣A∣=22,∣B∣=20,∣C∣=16.|A|=22,\qquad |B|=20,\qquad |C|=16.

The union contains 42 distinct elements, while the inclusive intersection A∩BA\cap B contains 5+2=75+2=7 elements. Adding the three set sizes would count shared elements more than once.

Ordering, filtering, and attributes

UpSet plots commonly order combinations by:

  • Size: the number of elements in each group.
  • Degree: the number of sets included in a combination.
  • Membership pattern: an arrangement that places related combinations together.

Here, degree means the number of participating sets; it does not measure the strength or significance of an association.

There are 2k2^k possible binary membership patterns for kk sets, including membership in none of them. Thus, up to 2k−12^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.

Implementations 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.

Extended 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.

History and implementations

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.

The 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.

Applications and limitations

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.

Their 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.

Important limitations include:

  • Combinatorial growth: Many sets can produce too many nonempty combinations for a readable display.
  • Loss of individual detail: Count bars do not identify the elements in a group unless labels, tables, or interactive views provide that information.
  • 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.
  • Universe dependence: Elements belonging to none of the sets are usually omitted. Their count requires a defined universe UU.
  • 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.

For 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.