1
votes

I would like to make many venn diagrams in one plot in R. I tried using the venneuler packages (and using par(mfrow=c(2,1))), however i would like that a circle in one venn diagram has the same size in all diagrams - if the value is the same.

When I do

require(venneuler) par(mfrow=c(2,1)) plot(venneuler(c(A=1, B=8, "A&B"=1))) plot(venneuler(c(A=1, C=1, "A&C"=1)))

I get enter image description here

But A in the first plot, should be same size as A and C in the second

1
But what size should B be in the first plot then?John
@TylerRinker: But that will still give the same result. The problem is that the biggest value in each vennDiagram is set to fill the entire plot. John: B should have an area 8 times as big as A and Cuser2335015
I tried a few techniques, but I think you may have to resort to recoding venneuler:::plot.VennDiagram by hand. Luckily, it's relatively short, and incorporating some cognizance of xlim and ylim shouldn't be too hard ...r2evans
... perhaps the problem is in venneuler() itself, which appears to be doing the auto-scaling for you. That function is s bit more work to modify. Perhaps you could contact the maintainer? It hasn't been touched in almost four years, though ...r2evans
Yes, that is exactly my problem. Do anyone know if there is a venndiagram package, where you can choose you own scaling?user2335015

1 Answers

1
votes

You can accomplish this with my r package eulerr. It returns grid graphics objects that can be arranged using the excellent gridExtra package.

library(eulerr)

p1 <- plot(euler(c(A = 1, B = 8, "A&B" = 1)))
p2 <- plot(euler(c(A = 1, C = 1, "A&C" = 1)))

gridExtra::grid.arrange(p1, p2)

enter image description here