1

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

FredBGA
  • 13
  • 4
  • Hi FredBGA. From your question, it is hard to know what is going on (perhaps you want to have at look at https://stackoverflow.com/help/how-to-ask). If you can send the data you used to create the diagrams, it will be much easier. My guess is that the element in the group with only one element is also in the group with four elements. Both diagrams support this, and both are equivalent. – vqf May 07 '19 at 16:37
  • Hello, I've edited the question with code and example of sets. – FredBGA May 13 '19 at 08:07

1 Answers1

2

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: enter image description here

vqf
  • 2,600
  • 10
  • 16