- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Python Matplotlib Venn diagram
To plot a Venn diagram, first install Venn diagram using command "pip install matplotlib-venn". Using venn3, plot a 3-set area-weighted Venn diagram.
Steps
Create 3 sets.
Using venn3, make a Venn diagram.
To display the figure, use show() method.
Example
import matplotlib.pyplot as plt from matplotlib_venn import venn3 plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = True set1 = {'A', 'B', 'C'} set2 = {'A', 'B', 'D'} set3 = {'A', 'E', 'F'} venn3([set1, set2, set3], ('Group1', 'Group2', 'Group3')) plt.show()
Output
- Related Articles
- What is a Venn diagram
- How to create a Venn diagram in R?
- How to modify the font size in Matplotlib-venn?
- How to create colored Venn Diagrams?
- How to plot complex numbers (Argand Diagram) using Matplotlib?
- Python matplotlib multiple bars
- How to show the title for the diagram of Seaborn pairplot() or PridGrid()? (Matplotlib)
- If A= {0 , 1 , 2 , 3 , 4 , 5} and B = {2 , 4 , 6 , 8 , 10} then find $displaystyle A cup B and A cap B$. Illustrate hem in venn diagram.
- If X = {1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9} and Y = {3 , 6 , 9 , 12 , 15 , 18} , find $(X - Y)$ and $(Y -X)$ and illustrate them in Venn diagram.
- How to import Matplotlib in Python?
- Vertical Histogram in Python and Matplotlib
- Manually add legend Items Python Matplotlib
- How to install matplotlib in Python?
- Plotting profile histograms in Python Matplotlib
- Python - Working with PNG Images using Matplotlib

Advertisements