Skip to content

Commit

Permalink
add venn 2~6 and demo
Browse files Browse the repository at this point in the history
  • Loading branch information
tctianchi committed Apr 14, 2016
1 parent 23f308f commit caec1f3
Show file tree
Hide file tree
Showing 3 changed files with 498 additions and 0 deletions.
Empty file added __init__.py
Empty file.
37 changes: 37 additions & 0 deletions demo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# coding: utf-8

# ipython notebook requires this
# %matplotlib inline

# python console requires this
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt

import venn

labels = venn.get_labels([range(10), range(5,15)], fill=['number', 'logic'])
fig, ax = venn.venn2(labels, names=['List 1', 'List 2'])
fig.savefig('venn2.png', bbox_inches='tight')
plt.close()

labels = venn.get_labels([range(10), range(5, 15), range(3, 8)], fill=['number', 'logic'])
fig, ax = venn.venn3(labels, names=['list 1', 'list 2', 'list 3'])
fig.savefig('venn3.png', bbox_inches='tight')
plt.close()

labels = venn.get_labels([range(10), range(5, 15), range(3, 8), range(8, 17)], fill=['number', 'logic'])
fig, ax = venn.venn4(labels, names=['list 1', 'list 2', 'list 3', 'list 4'])
fig.savefig('venn4.png', bbox_inches='tight')
plt.close()

labels = venn.get_labels([range(10), range(5, 15), range(3, 8), range(8, 17), range(10, 20)], fill=['number', 'logic'])
fig, ax = venn.venn5(labels, names=['list 1', 'list 2', 'list 3', 'list 4', 'list 5'])
fig.savefig('venn5.png', bbox_inches='tight')
plt.close()

labels = venn.get_labels([range(10), range(5, 15), range(3, 8), range(8, 17), range(10, 20), range(13, 25)], fill=['number', 'logic'])
fig, ax = venn.venn6(labels, names=['list 1', 'list 2', 'list 3', 'list 4', 'list 5', 'list 6'])
fig.savefig('venn6.png', bbox_inches='tight')
plt.close()

Loading

0 comments on commit caec1f3

Please sign in to comment.