Is there a way to force overlap of two circles?

为君一笑 提交于 2019-12-25 01:41:26

问题


I would like to draw a Venn Diagram really close to what the R Limma Package does.

In this case I have a set that does not overlap the two others. R package shows that with "0", but matplolib-venn draws another circle.

edit:

My 3 sets are:

  • 9
  • 7 8 9 10
  • 1 2 3 4 5 6

My code is:

set2 = set([9])
set1 = set([7, 8, 9, 10])
set3 = set([1, 2, 3, 4, 5, 6])

sets = [set1, set2, set3]
lengths = [len(one_set) for one_set in sets]

venn3([set1, set2, set3], ["Group (Total {})".format(length) for (length) in lengths]) 

Thank you.

R Limma: https://i.ibb.co/h9yhgm1/2019-05-07-Screen-Hunter-06.jpg

matplotlib_venn: https://i.ibb.co/zx6YJbz/2019-05-07-Screen-Hunter-07.jpg

Fred


回答1:


There is no element that is common to set3 and either set1 or set2. Both diagrams are correct. If you want to show all the spaces, you can try with venn3_unweighted:

from matplotlib_venn import venn3_unweighted

set2 = set([9])
set1 = set([7, 8, 9, 10])
set3 = set([1, 2, 3, 4, 5, 6])

sets = [set1, set2, set3]
lengths = [len(one_set) for one_set in sets]

venn3_unweighted([set1, set2, set3], ["Group (Total {})".format(length) for (length) in lengths])

And the result:



来源:https://stackoverflow.com/questions/56021855/is-there-a-way-to-force-overlap-of-two-circles

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!