Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from matplotlib import pyplot as plt
- from matplotlib_venn import venn2
- from collections import OrderedDict
- named_sets = {'x1': set(['foo','foo','bar',"pax"]), "x3" : set(['foo','qux','bar',"zoo"])}
- od = OrderedDict(sorted(named_sets.iteritems()))
- circlenm = ()
- circlels = []
- for k,v in od.iteritems():
- circlenm = circlenm + (k,)
- circlels.append(v)
- c = venn2(subsets = circlels,set_labels = circlenm)
- c.get_patch_by_id('10').set_color('red')
- c.get_patch_by_id('01').set_color('blue')
- c.get_patch_by_id('10').set_edgecolor('none')
- c.get_patch_by_id('01').set_edgecolor('none')
- c.get_patch_by_id('10').set_alpha(0.4)
- c.get_patch_by_id('01').set_alpha(0.4)
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement