利用R画Venn(文氏图、韦恩)图

  • A+
所属分类:Script

> library(VennDiagram)
Loading required package: grid
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

输出1表示画图成功,生成的结果是out.tiff,这个文件在你的R工作目录下。

另外推荐一个在线画venn(文氏图)的工具(可以画4个环)

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

avatar

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

目前评论:2   其中:访客  2   博主  0

    • avatar fqiang1024 1

      怎么收藏文章呢

      • avatar GFK 0

        用www.omicsbean.cn绘制venn图,没有组数限制