Does anyone know how to get the R package VennDiagram to scale the circles of a Venn diagram containing 3 intersecting sets according to set size?
I can achieve such scaling with the venneular package, but I find this a bit limited in terms of other graphical options compared to VennDiagram.
The VennDiagram package documentation suggests setting the argument 'scaled' to TRUE ought to do the trick, but I find this produces 3 circles of equal size.
The package documentation does cryptically suggest that the scaled argument may only work for certain diagrams:
?draw.triple.venn
reveals:
scaled: "Boolean indicating whether to scale circle sizes in certain Euler diagrams according to set sizes or not"
and
?venn.diagram
#Argument Venn Sizes Class Description
#scaled 2, 3 logical Enable scaling for two-set and certain three-set Euler diagrams.
A toy example of my code:
require(VennDiagram)
venn.plot <- draw.triple.venn(
area1 = 70,
area2 = 250,
area3 = 500,
n12 = 30,
n23 = 60,
n13 = 10,
n123 = 5,
category = c("C1", "C2", "C3"),
fill = c("blue", "red", "green"),
scaled=TRUE)
tiff(filename = "test.tiff", compression = "none",type = "quartz",antialias = "none")
grid.draw(venn.plot)
dev.off()
Similarly this code using the 'venn.diagram' function doesn't produce the required scaling:
venn.diagram(x=list(A=c(1:15,16:20), B=c(6:15,21:30,100:150), C=c(11:30,200:300)),
filename="test.tiff",
fill = c("blue", "yellow", "red"), scaled=TRUE)
Thanks v.much
Jim
Install “VennDiagram” Package (One-time setup)At the project list view, you can click “R Packages” link to open the 'Manage R Package” dialog. Click the “Install New Packages” tab, type in “VennDiagram” in the input field, and click “Install”. You will see a success message if the installation goes well.
A Venn diagram is a classic way of getting students to compare and contrast the similarities and differences between two or three key events, concepts or people.
A Venn diagram is a diagram that shows the relationship between and among a finite collection of sets. If we have two or more sets, we can use a Venn diagram to show the logical relationship among these sets as well as the cardinality of those sets. In particular, Venn Diagrams are used to demonstrate De Morgan's Laws.
My solution:
overrideTriple=T
draw.triple.venn(9, 20, 30, 2, 10, 3, 2, category =
rep("", 3), rotation = 1, reverse = FALSE, euler.d = F, scaled = F)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With