Bjorn Blomberg
Bjorn Blomberg

Reputation: 63

Triple venn-diagram in R: How to get proportions of the area right

I am trying to compare different test methods using venn diagrams in R by using the package VennDiagram. I run into the problem that areas are not proportional to the size of the numbers. It all works nicely then I compare 2 test-methods as follows:

draw.pairwise.venn(44, 32, 28, c("TestA", "TestB"), fill = c("red", "blue"))

But, when I try to compare 3 methods, the areas are not proportional anymore. I have tried to add some "extras" like eulerr.d = TRUE and scaled = TRUE, but don't seem to help.

draw.triple.venn(44, 39, 32, 39, 25, 28, 25, c("TestA", "TestC", "TestB"),  fill = c("red", "green", "blue"), euler.d = TRUE, scaled = TRUE)

Any tips on how to get around this?

Thank you in advance,

Bjorn

Upvotes: 0

Views: 1621

Answers (3)

vqf
vqf

Reputation: 2628

You cannot display arbitrary proportional Venn or Euler diagrams for three or more sets using circles. There is a closed thread in stackoverflow about different packages to do this. A couple of options would be eulerr (vignette), which uses ellipses and a loss function, and the one I developed, nVennR (vignette), which uses other shapes and keeps almost exact proportions.

Upvotes: 0

Carl Witthoft
Carl Witthoft

Reputation: 21502

Neither Venn nor Euler diagrams require overlap areas to be proportional to magnitude of content, tho' I understand it makes the graph marginally more useful. I strongly recommend investigating the package UpSetR which provides some really cool, and instructive graphic representations of set overlaps.

In the meantime, I would go with user20650's suggestion to play with eulerr and see if you find it easier to get the overlay plot you want. Also at CRAN: bvenn, venneuler, vennplot, and several other packages of possible interest.

Side nit: If you are only plotting overlaps with content, then it's an Euler, not Venn diagram.

Upvotes: 1

Miff
Miff

Reputation: 7941

The arguments you've used do create a scaled plot for some sets of values, e.g.

draw.triple.venn(1, 3, 5, 0, 1, 0, 0, c("TestA", "TestC", "TestB"),  
                 fill = c("red", "green", "blue"))

enter image description here

It seems that for other sets of parameters it is not possible (or not coded) to make the areas proportional to the values

Upvotes: 1

Related Questions