konstantint / matplotlib-venn

Area-weighted venn-diagrams for Python/matplotlib
MIT License
508 stars 68 forks source link

Add Venn Areas graphic #51

Closed Sieboldianus closed 2 months ago

Sieboldianus commented 4 years ago

First of all, many thanks for this awesome package!

Not knowing Venn Diagrams and having little math background, I was first confused by the syntax (Abc, aBc, ABc, abC, AbC, aBC, ABC) - looking at Inclusion–exclusion principle I thought e.g. aBc meant |B|.

Anyway, what would really help would be to add a graphic to illustrate these areas. I created the following with the help of matplotlib-venn:

venn

v = venn3(
    subsets=(
        500,
        500, 
        100,
        500,
        100,
        100,
        10),
    set_labels = ('A', 'B', 'C'))
v.get_label_by_id('100').set_text('Abc')
v.get_label_by_id('010').set_text('aBc')
v.get_label_by_id('001').set_text('abC')
v.get_label_by_id('110').set_text('ABc')
v.get_label_by_id('101').set_text('AbC')
v.get_label_by_id('011').set_text('aBC')
v.get_label_by_id('111').set_text('ABC')
plt.show()

Perhaps this could be added to the README.md?

konstantint commented 2 months ago

Done. It only took some 4 years, yay!

(But then, to be fair, literally nobody else in the world could find the time to send a PR with this (one-liner) change to the docs in the meantime either).

Sieboldianus commented 2 months ago

Haha, I am sorry - I could have done that, apologies. And many thanks for your work. A little gem in the package universe.