自用Venn代码
library (VennDiagram)
library(openxlsx)
set1 <- read.xlsx("venn.xlsx",sheet = "dvf",colNames = F)
set2 <- read.xlsx("venn.xlsx",sheet = "vs2",colNames = F)
set3 <- read.xlsx("venn.xlsx",sheet = "vb",colNames = F)
set1=t(set1)
length(set1)
set2=t(set2)
length(set2)
set3=t(set3)
length(set3)
vennplot <- venn.diagram(x=list(set1,set2,set3),
scaled = F, # 根据比例显示大小
alpha= 0.8, #透明度
lwd=4,lty=1,col="white", #圆圈线条粗细、形状、颜色;1 实线, 2 虚线, blank无线条
label.col ='black' , # 数字颜色label.col=c('#FFFFCC','#CCFFFF',......)根据不同颜色显示数值颜色
cex = 2, # 数字大小
fontface = "bold", # 字体粗细;加粗bold
fill=c('#e0d9b8','#b8d8ee',"#e0f2ee"), # 填充色
category.names = c("Deepvirfinder","Virsorter2","VIBRANT") , #标签名
cat.dist = 0.02, # 标签距离圆圈的远近
cat.pos = c(-10, 10, -180), # 标签相对于圆圈的角度cat.pos = c(-10, 10, 135)
cat.cex = 2, #标签字体大小
cat.fontface = "bold", # 标签字体加粗
cat.col='black' , #cat.col=c('#FFFFCC','#CCFFFF',.....)根据相应颜色改变标签颜色
cat.default.pos = "outer", # 标签位置, outer内;text 外
cat.fontfamily = "Arial", # 字体
fontfamily = "Arial", # 字体
output=TRUE,
filename='C:/Users/###/dvf_vs2_vb.png',# 文件保存
height = 4000, # 图片高度
width = 4000, # 图片宽度
imagetype="png", # 类型(tiff png svg)
resolution = 350 # 分辨率
# compression = "lzw"# 压缩算法
)