ismaelvc

venn_test.py

Nov 14th, 2013
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. from matplotlib_venn import venn3
  2. from matplotlib import pyplot as plt
  3. from collections import Counter
  4.  
  5. set1 = set(['A', 'B', 'C', 'D'])
  6. set2 = set(['B', 'C', 'D', 'E'])
  7. set3 = set(['C', 'D',' E', 'F', 'G'])
  8.  
  9. union = set1.union(set2).union(set3)
  10.  
  11. indicators = ['%d%d%d' % (a in set1, a in set2, a in set3) for a in union]
  12.  
  13. subsets = Counter(indicators)
  14.  
  15. test = venn3(subsets, ('Set1', 'Set2', 'Set3'))
  16.  
  17. plt.plot(test)
  18. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment