我只是在 Matplotlib 中更改了字体大小(也可以使用 rcParams 更改文本颜色)。
from matplotlib_venn import venn3
from matplotlib import pyplot as plt
plt.figure(figsize = (6, 5))
font1 = {'family':'serif','color':'black','size':16} # use for title
font2 = {'family': 'Comic Sans MS', 'size': 8.5} # use for labels
plt.rc('font', **font2) # sets the default font
plt.rcParams['text.color'] = 'darkred' # changes default text colour
venn3(subsets=({'A', 'B', 'C', 'D', 'X', 'Y', 'Z'},
{'A', 'B', 'E', 'F', 'P'}, {'B', 'C', 'E', 'G'}),
set_labels=('Set1', 'Set2', 'Set3'),
set_colors=("coral", "skyblue", "lightgreen"), alpha=0.9)
plt.title("Changing Font Size in Matplotlib_venn Diagrams", fontdict=font1)
plt.show()