I have the following Venn diagrams:
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'))
That looks like this:
How can I control the font size of the plot? I'd like to increase it.
Plot x data points using plot() method. To change the font size of the scale in matplotlib, we can use labelsize in the ticks_params()method. To display the figure, use show() method.
Open the Python shell. Then, in the menu bar, under "Python" (directly to the right of the Apple icon), you will find "Preferences". Under this, you will find the "Font/Tabs" option, and you can change the font size according to your preference.
If out
is the object returned by venn3()
, the text objects are just stored as out.set_labels
and out.subset_labels
, so you can do:
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With