# Venn diagram

Plotting of Venn diagrams for two or three sets, with a number of options. Circles can be plotted with equal sizes, or with sizes and overlaps proportional to the number of members.

### Two sets

The input data for two sets A and B can be given as a 2x2 contingency table on this form:

A and B |
A, not B |

B, not A |
Not A, not B |

The not A, not B value is only used when the Show none box is ticked.

Alternatively, the values can be given in a single column with 3 or 4 rows as follows:

A, not B

B, not A

A and B

Not A, not B (this value is optional)

### Three sets

The input data for three sets A, B and C are given in a single column with 7 or 8 rows:

A, not B, not C (ABC=100)

B, not A, not C (ABC=010)

A and B, not C (ABC=110)

C, not A, not B (ABC=001)

A and C, not B (ABC=101)

B and C, not A (ABC=011)

A and B and C (ABC=111)

not A, not B, not C (ABC=000) (this value is optional)

Example data:

20

10

12

8

9

4

3

80

Plotting of a fully size-proportional 3-set Venn diagram with circles is not generally possible. Past prioritizes the total sizes of circles and the pairwise overlapping regions. The algorithm is inspired by the matplotlib-venn Python code by Konstantin Tretyakov.