2-4 Sets Venn Diagram For Python
pipx install git+https://github.com/mmngreco/pyvenn.git
venn
git clone git+https://github.com/mmngreco/pyvenn.git
cd pyvenn
python -m venv venv
pip install -e .
Or use pipx
:
pipx run -e venn.py --help
Plot functions are based on the labels:
import venn
fig, ax = venn.venn2(labels, names=['list 1', 'list 2'])
fig.show()
More examples:
labels = venn.get_labels([range(10), range(5, 15), range(3, 8)], fill=['number', 'logic'])
fig, ax = venn.venn3(labels, names=['list 1', 'list 2', 'list 3'])
fig.show()
labels = venn.get_labels([range(10), range(5, 15), range(3, 8), range(8, 17)], fill=['number', 'logic'])
fig, ax = venn.venn4(labels, names=['list 1', 'list 2', 'list 3', 'list 4'])
fig.show()