--- id: matplotlib-venn version: "1.1.2" license: MIT license_treatment: permissive maintenance: active --- # matplotlib-venn — Functions for plotting area-proportional two- and three-way Venn diagrams in matplotlib. License: permissive · Maintenance: active · Downloads: 285.8K/mo ## What it is and what it does matplotlib-venn provides four main functions—venn2, venn2_circles, venn3, and venn3_circles—that render two- and three-circle Venn diagrams with region areas proportional to subset sizes. You pass either a tuple of subset counts or a tuple of set objects, and the package draws colored patches with text labels showing the overlaps. The functions return objects that expose the underlying Matplotlib patches and text elements for further customization. The package includes two layout algorithms: a default pairwise algorithm that balances the representation of individual set sizes and pairwise intersections, and an optional cost-based algorithm (requiring Shapely) that optimizes circle placement against a user-provided cost function. The description notes that exact area correspondence is not always achievable for three-circle diagrams, and provides tuning options via fixed_subset_sizes and alternative layout algorithms. Use it for: - Visualize overlaps between two or three datasets (e.g., genes in different experiments, users across platforms) - Compare membership of sets in scientific or statistical analysis to show intersection sizes at a glance - Generate publication-ready Venn diagrams with customizable colors, labels, and styling via Matplotlib - Explore set relationships interactively by tuning layout algorithms and cost functions for better visual clarity - Embed Venn diagrams in multi-panel figures or dashboards using Matplotlib's subplot and axes API ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Plots area-weighted two- and three-circle Venn diagrams using Matplotlib, with optional support for cost-based layout optimization via Shapely. Yes, if you already have Matplotlib, NumPy, and SciPy in your environment and need to visualize two- or three-way set overlaps. The package is actively maintained, has no known vulnerabilities, and is widely used (top 15000 on PyPI). High install friction is a minor concern only if you lack the core scientific stack; the MIT license poses no restrictions. ## Install pip install matplotlib-venn uv add matplotlib-venn poetry add matplotlib-venn ## Installing matplotlib-venn Before you install: High install friction: the package itself has no runtime dependencies, but Matplotlib, NumPy, and SciPy must be present in your environment. The optional Shapely dependency unlocks an alternative layout algorithm for three-circle diagrams; the description notes Shapely may become required in future versions. License in practice: MIT license is permissive—you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions. Quickstart: pip install matplotlib-venn from matplotlib_venn import venn2 venn2(subsets=(3, 2, 1)) # Or with sets: from matplotlib_venn import venn3 venn3([set(['A', 'B', 'C']), set(['B', 'C', 'D']), set(['C', 'D', 'E'])]) Requires Matplotlib, NumPy, and SciPy to be installed. Cost-based layout for venn3 requires optional Shapely dependency. Verify before relying: - Whether the package works with modern Python versions (requires_python is unspecified in metadata) - Performance characteristics when handling large subset sizes or complex diagrams ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: high - Maintenance: active - Downloads: 285.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags venn diagram plotting, area-weighted venn diagrams, matplotlib venn circles, set intersection visualization, two-way three-way venn, venn diagram layout, set overlap diagrams, set-visualization, matplotlib-extension [View on SkillFed](https://skillfed.io/packages/matplotlib-venn) · [View on PyPI](https://pypi.org/project/matplotlib-venn/)