Is it possible to create a proportional triple Ven

2019-08-21 08:58发布

问题:

I am trying to create a proportional Venn Diagram with three groups. I searched the web and tried with 3 different packages: Venndiagram, venneuler and eulerr. However, with none it seems that it creates a correct proportional diagram. Can anyone help how to do this?

I tried with Venndiagram package:

library(Venndiagram)
draw.triple.venn(58, 44, 37, 44, 27, 37, 27, c("A", "B", "C"), euler.d = TRUE, scaled = TRUE)

Although scaled = TRUE, this gave me the following diagram:

When using venneuler package:

library(venneuler)
v <- venneuler(c(A = 4, B = 0, C = 0, "A&B" = 10, "A&C" = 17, "B&C" = 0, "A&B&C" = 27))
plot(v)

This seemed to work better. However, as you can see, there is an area of B and C outside of A although this needs to be 0. Maybe this is impossible with circles?

回答1:

You are right, it is impossible with circles. However, if you're willing to use ellipses instead, the latest development version of eulerr (that I happen to the be creator of) can help you.

devtools::install_github("jolars/eulerr")

v <- eulerr::euler(c(A = 4, B = 0, C = 0,
                     "A&B" = 10, "A&C" = 17, "B&C" = 0, "A&B&C" = 27),
                   shape = "ellipse")
plot(v)

yields

Which is a perfect fit.

      original fitted residuals regionError
A            4      4         0           0
B            0      0         0           0
C            0      0         0           0
A&B         10     10         0           0
A&C         17     17         0           0
B&C          0      0         0           0
A&B&C       27     27         0           0

diagError: 0 
stress:    0