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 - dictionary 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.
  • colors - set of colors for each set, default is "bgrc".
  • line_width - control line width.
  • font_size - control font size.
  • legend_cols - number of legend columns, default is 2.
  • column_spacing - column spacing in legend, default is 4.
  • edge_color - edge colors, default is 'black'.
  • alpha - fill opacity of the sets, default is 0.3.

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.4.tar.gz (753.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

venny4py-1.0.4-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file venny4py-1.0.4.tar.gz.

File metadata

  • Download URL: venny4py-1.0.4.tar.gz
  • Upload date:
  • Size: 753.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for venny4py-1.0.4.tar.gz
Algorithm Hash digest
SHA256 957042ac84f2494c9cb7314c4858d0556c0d911a891e698deb0bf6047305cafd
MD5 a632bab45627a951712232d400b04fbb
BLAKE2b-256 c60e83a4fa2166f004c7ba1645ef64ebcc08aebc911c9b940453faa1cd998256

See more details on using hashes here.

File details

Details for the file venny4py-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: venny4py-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for venny4py-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 fdccc14f514aa5ad5c2350532d45e4eb04f6fbc62e3a16dcb50bd1f24631c17f
MD5 a2b005e0d486d5cc01e30649a4a67b6b
BLAKE2b-256 3cd3bcb5fd0b2249e8ca56b1759c6f8998e4cf50f437c612dec1680cba7c298f

See more details on using hashes here.

Supported by

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