R语言画维恩图
画维恩图时考虑到不同集合的大小,想用R画图,遇到下面的问题
直接采用下面的代码计算时,
rm(list=ls()) data = read.csv("H:/test.csv",sep = ",") data1 = data[,1] data2 = data[,2] venn.diagram(list(WDSP=data1,Pfam=data2), resolution = 300, imagetype = "tiff", alpha=c(0.5,0.5,0.5), fill=c("red","yellow"), cat.fontface=4,fontfamily=3, main="Intersection of WDSP and Pfam", main.cex = 2, main.fontface = 2, main.fontfamily = 3, filename = "VennDiagram.tif")
上面的代码直接提示报错:
最后解决问题如下:
windowsFonts(HEL=windowsFont("Helvetica CE 55 Roman"), RMN=windowsFont("Times New Roman"), ARL=windowsFont("Arial")) venn.diagram(list(WDSP=data1,Pfam=data2), resolution = 300, imagetype = "tiff", alpha=c(0.5,0.5), fill=c("red","yellow"), cat.fontface=4,fontfamily="ARL", main="Intersection of WDSP and Pfam", main.cex = 2, main.fontface = 2, main.fontfamily = "HEL", filename = "VennDiagram.tif")
最后由于数据的原因,画出的图形比较特殊
原文链接:https://www.jianshu.com/p/a653ea616407