3.9 Venn Chart
A Venn diagram is an illustration that uses circles to show the relationships among things or finite groups of things. Venn diagrams help to visually represent the similarities and differences between the two concepts.
We can usematplotlib-venn
the library to draw a Venn chart. It contains four main functions: venn2
, venn2_circles
, venn3
and venn3_circles
.
1. Installation
2. 2-Group Venn Chart
There are two ways to draw a Venn Chart. One is to give directly the size of your group and their intersection. The other is to give 2 sets of values, python will calculate itself the length of each set (each group) and the number of common values (their intersection).
The functions venn2 and venn2_circles accept as their only required argument a 3-element list (Ab, aB, AB) of subset sizes
Option 1
Option 2
3. 3-Group Venn Chart
Similarly, the functions venn3 and venn3_circles take a 7-element list of subset sizes (Abc, aBc, ABc, abC, AbC, aBC, ABC)
Last updated