【1.8】VennDiagram做文氏图

install.packages("VennDiagram”)
library(VennDiagram)
Warning message:
package 'VennDiagram' was built under R version 2.13.0

x <- c(1,3,5,7,9,11,17,19,21,23,25,29,31,33,37,39,41,47,49,51,57,59);
y <- c(1,3,5,7,13,17,19,21,23,25,27,29,31,33,45,47,51);
z <- c(1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,55,57,59,61);

venn.diagram(list(X=x,Y=y,Z=z),fill=c("red","blue","yellow"),"out.tiff")

[1] 1


venn.diagram(list(X=x,Y=y,Z=z),fill=c("red","green","blue"),alpha=c(0.5,0.5,0.5),cex=2, cat.fontface=4, fontfamily=3, filename="VennDiagram.tiff")


http://bioinfogp.cnb.csic.es/tools/venny/index.html

A = 1:150
B = c(121:170,300:320)
C = c(20:40,141:200)
Length_A<-length(A)
Length_B<-length(B)
Length_C<-length(C)
Length_AB<-length(intersect(A,B))
Length_BC<-length(intersect(B,C))
Length_AC<-length(intersect(A,C))
Length_ABC<-length(intersect(intersect(A,B),C))


draw.pairwise.venn(area1=Length_A,area2=Length_B,cross.area=Length_AB
,category=c('A','B'),lwd=rep(1,1),lty=rep(2,2)
,col=c('red','green'),fill=c('red','green')
,cat.col=c('red','green')
,rotation.degree=90)


draw.triple.venn(area1=Length_A, area2=Length_B, area3=Length_C
,n12=Length_AB, n23=Length_BC, n13=Length_AC, n123=Length_ABC
,category = c('A','B','C')
,col=c('red','green','blue'),fill=c('red','green','blue')
,cat.col=c('red','green','blue')
,reverse = FALSE)