Here is an example of plotting 4 venn diagrams in a single screen with a 2*2 layout.


library(VennDiagram)

#defining vectors
av<- 1:10
bv<- 12:20
cv<-  7:15

# Building venndiagram grid objects (i.e. gList)
a<- venn.diagram(list(av= av, bv=bv), filename=NULL, main="VD1")
b<- venn.diagram(list(av=av, cv=cv), filename=NULL, main="VD2")
c<- venn.diagram(list(bv=bv, cv=cv), filename=NULL, main="VD3")
d<- venn.diagram(list(av=av, cv=cv), filename=NULL, main="VD4")

# Draw the diagrams
pushViewport(plotViewport(layout=grid.layout(2, 2)))
pushViewport(plotViewport(layout.pos.col=1, layout.pos.row=1))
grid.draw(a)
popViewport()
pushViewport(plotViewport(layout.pos.col=2, layout.pos.row=1))
grid.draw(b)
popViewport()
pushViewport(plotViewport(layout.pos.col=1, layout.pos.row=2))
grid.draw(c)
popViewport()
pushViewport(plotViewport(layout.pos.col=2, layout.pos.row=2))
grid.draw(d)



1

View comments

Labels
Blog Archive
About Me
About Me
My Photo
I am a Postdoc researcher at the Neuromuscular Disorders Research lab and Genetic Determinants of Osteoporosis Research lab, in University of Helsinki and Folkhälsan RC. I specialize in Bioinformatics. I am interested in Machine learning and multi-omics data analysis. My go-to programming language is R.
My Blog List
My Blog List
Loading
Dynamic Views theme. Powered by Blogger. Report Abuse.