我有以下维恩图:
from matplotlib import pyplot as plt
from matplotlib_venn import venn3, venn3_circles
set1 = set(['A', 'B', 'C', 'D'])
set2 = set(['B', 'C', 'D', 'E'])
set3 = set(['C', 'D',' E', 'F', 'G'])
venn3([set1, set2, set3], ('Set1', 'Set2', 'Set3'))
看起来像这样:
如何控制绘图的字体大小?
我想增加它。
最佳答案
如果out
是venn3()
返回的对象,则文本对象仅存储为out.set_labels
和out.subset_labels
,因此您可以执行以下操作:
from matplotlib import pyplot as plt
from matplotlib_venn import venn3, venn3_circles
set1 = set(['A', 'B', 'C', 'D'])
set2 = set(['B', 'C', 'D', 'E'])
set3 = set(['C', 'D',' E', 'F', 'G'])
out = venn3([set1, set2, set3], ('Set1', 'Set2', 'Set3'))
for text in out.set_labels:
text.set_fontsize(14)
for text in out.subset_labels:
text.set_fontsize(16)
关于python - 如何在matplotlib-venn中修改字体大小,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/29426075/