Venn Plot

import matplotlib.pyplot as plt
from matplotlib_venn import venn2,venn2_circles

import matplotlib as mpl
mpl.rcParams['font.serif'] = 'Arial'
mpl.rcParams['pdf.fonttype'] = 42

compare lists

list_a = ['a','b']
list_b = ['b','c','d']
f, ax = plt.subplots(figsize=(5, 5))
g = venn2([set(list_a), set(list_b)],
          ax=ax,
          set_colors=['white', 'white'],
          set_labels=['a', 'b'])
v = venn2_circles(
    [set(list_a), set(list_b)],
    ax=ax,
)
v[0].set_edgecolor('r')
v[1].set_edgecolor('b')

# plt.savefig('./venn.pdf') # VennDiagram does not have the method savefig
../_images/Venn_plot_4_0.png

assign subsets manully