This repository contains two Python scripts for generating Venn diagrams:
- venn2set.py: Generates all possible Venn diagram combinations for two sets (A, B).
- venn3set.py: Generates all possible Venn diagram combinations for three sets (A, B, C).
Common Features:
- Generates all unique combinations: Produces a complete set of Venn diagrams, covering all possible intersections and unions of the sets.
- Customizable colors: Each diagram uses a unique color generated from a color palette.
- Saves PNG images: The scripts save each diagram as a separate PNG image in the venn_diagrams folder.
- Roboto font: Uses the Roboto font for a clean and modern look.
Specific Features:
venn2set.py
:- Generates 2^3 = 8 unique combinations for two sets.
venn3set.py
:- Generates 2^7 = 128 unique combinations for three sets.
- Python 3.x
- matplotlib
- matplotlib-venn
- fonttools (for Roboto font)
Install the required packages using pip:
pip install matplotlib matplotlib-venn fonttools
For both scripts:
- Download the script: Download the desired script from this repository.
- Place Roboto font file: Make sure the RobotoMono-Regular.ttf font file is in the same directory as the script (or adjust the font_path variable in the script).
- Run the script: Execute the script using Python:
python venn2set.py # For two sets python venn3set.py # For three sets
- Check the output: The generated Venn diagrams will be saved in the venn_diagrams folder.
The scripts will create a series of PNG files named venn_diagram_001.png
, venn_diagram_002.png
, and so on. Each file will contain a unique Venn diagram combination.