Reputation: 113
How can I create a venn diagram in python from 4 sets? Seems like the limit in matplotlib is only 3?
from matplotlib_venn import venn3
v = venn3(
[
set(ether_list),
set(bitcoin_list),
set(doge_list),
],
)
Upvotes: 10
Views: 20322
Reputation: 142
There is a new python 3 package venny4py that can create Venn diagrams with up to 4 sets. It can plot and save figure or plot it as a subplot of your own matplotlib figure, figure size and dpi adjustable.
Example:
pip install venny4py
from venny4py.venny4py import *
#dict of sets
sets = {
'Set1': set(list("Harry Potter")),
'Set2': set(list("Hermione Granger")),
'Set3': set(list("Ron Weasley")),
'Set4': set(list("Severus Snape"))}
venny4py(sets=sets)
More details can be found here
Upvotes: 3