绘制venn图,2-7维

绘制venn图,2-7维




library(ggVennDiagram)
#> Warning: package 'ggVennDiagram' was built under R version 4.2.3
genes <- paste("gene",1:1000,sep="")
set.seed(20210419)
x <- list(A=sample(genes,300),
          B=sample(genes,525),
          C=sample(genes,440),
          D=sample(genes,440),
          E=sample(genes,440),
          F=sample(genes,150),
          G=sample(genes,300)
          )
ggVennDiagram(x,
              #set_color = c("blue","red","yellow","black"), # 集合名字颜色
              set_size = 6,# 集合名字大小
              label = "count", # "count","percent","both","none"
              label_geom = "label", # label/text,
              label_alpha = 0, # label背景色
              label_color = "black",
              label_percent_digit = 2, # 保留几位小数
              edge_lty = "solid", # 边框线型,solid,dashed
              edge_size = 1.2 # 边框粗细
              )+scale_fill_gradient(low="#ffffb2",high = "#b10026")+ # 填充色
  scale_color_brewer(palette = "Set1" )# 边框色,貌似不能变为无边框



attachments-2023-11-8GuwY5dn6551bad7bfb3e.png

#准备韦恩图数据列表,一列为一组ID
data<-read.table("data.txt",header=T,check.names = F,stringsAsFactors = F,sep="\t",fill=T,na.string="")
x<-as.list(data)
x<-lapply(x,na.omit)
  • 发表于 2023-11-13 13:59
  • 阅读 ( 874 )
  • 分类:R

0 条评论

请先 登录 后评论
omicsgene
omicsgene

生物信息

698 篇文章

作家榜 »

  1. omicsgene 698 文章
  2. 安生水 347 文章
  3. Daitoue 167 文章
  4. 生物女学霸 120 文章
  5. xun 80 文章
  6. 红橙子 78 文章
  7. rzx 74 文章
  8. CORNERSTONE 72 文章