简体   繁体   中英

Why my VennDiagram doesn't create a plot?

I am trying to make Venn Diagram in R. I am using the same code I used a few months back. It worked that time. But now the code returns 1 and no plot is made.

venn.diagram(
  x = list(RPPA_NF2_PTEN_upregulated_synergy, RPPA_PTEN_TP53_upregulated_synergy, RPPA_NF2_TP53_upregulated_synergy),
  category.names = c("NF2_PTEN_up_syn" , " PTEN_TP53_up_syn " , "NF2_TP53_up_syn"),
  filename = 'up_syn_venn_diagram.png',
  output=TRUE,  imagetype="png" ,
  height = 480 , 
  width = 480 , 
  resolution = 300,
  compression = "lzw",
  fill = myCol,
  cat.cex = 0.2,
  cat.fontface = "bold",
  cat.default.pos = "outer",
  cat.pos = c(-27, 27, 135),
  cat.dist = c(0.055, 0.055, 0.085),
  cat.fontfamily = "sans",
  rotation = 1
)

The output is: [1] 1

Edit: Adding in the data provided in comments below

RPPA_NF2_PTEN_upregulated_synergy <- c("17","21","22","28","32","33","45","53","69","73","101","105","118","124","132","134","141","148","154","163","177","189","214","223","225","234","247","257","265","266","277","287","295","306","309","310","316","330","334","352","361","367","368","370","386","390","393","394","403","405","410","419","420","432","441","447","473","486","489")
RPPA_PTEN_TP53_upregulated_synergy <- c("10","13","21","22","28","32","33","45","47","95","101","104","105","112","118","124","132","134","141","148","154","156","158","163","177","179","180","184","188","189","198","203","212","214","215","223","225","226","227","234","236","241","257","266","277","285","286","287","289","295","301","306","309","316","328","330","339","361","367","368","370","394","403","410","414","419","420","432","441","447","456","462","486","489")
RPPA_NF2_TP53_upregulated_synergy <- c("22","65","87","124","132","141","154","165","177","225","234","257","266","277","287","295","306","309","310","328","334","367","368","419","420","441","447","473")

Assuming that myCol is defined somewhere, your code is creating a Venn plot and saving it into a file called up_syn_venn_diagram.png . By default, this function does not draw the diagram into the plot window. You can do that manually by setting filename to NULL and plotting the object returned:

vplot <- venn.diagram(
  x = list(RPPA_NF2_PTEN_upregulated_synergy, RPPA_PTEN_TP53_upregulated_synergy, RPPA_NF2_TP53_upregulated_synergy),
  category.names = c("NF2_PTEN_up_syn" , " PTEN_TP53_up_syn " , "NF2_TP53_up_syn"),
  filename = NULL,
  output=TRUE,  imagetype="png" ,
  height = 480 , 
  width = 480 , 
  resolution = 300,
  compression = "lzw",
  fill = 'red',
  cat.cex = 0.2,
  cat.fontface = "bold",
  cat.default.pos = "outer",
  cat.pos = c(-27, 27, 135),
  cat.dist = c(0.055, 0.055, 0.085),
  cat.fontfamily = "sans",
  rotation = 1
)

grid.draw(vplot)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM