Skip to main content

Python3 package to create Venn diagrams with 2-4 sets.

Project description

Venny4Py

Simple Venn diagrams for Python 3, up to 4 sets (for more than 4 sets it is better to use UpSet plot). It will take as input a dictionary of 2-4 sets and produce a venn diagram and a txt file with element intersections.

Dependencies:

  • itertools
  • matplotlib

Installation:

pip install venny4py

When installed, import:

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)

Parameters:

  • sets - disctionary of sets (required)
  • out - directory to output files, default current directory
  • asax - if diagram should be plotted as subplot, then provide matplotlib ax here. Default is 'False' which will plot new figure
  • ext - image extension, default is 'png'.
  • dpi - image resolution, default is 300 dpi.
  • size - image size in inches, default is 3.5. If using custom ax through "asax" parameter, specify approximate size of subplot in inches since fontsize is dependent on this parameter.

Check "Examples.ipynb" https://github.com/timyerg/venny4py/blob/main/Examples.ipynb to see some examples.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

venny4py-1.0.3.tar.gz (219.8 kB view hashes)

Uploaded Source

Built Distribution

venny4py-1.0.3-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page