How to assign name to every circle in a Venn diagram using R (Venndiagram package)

StackOverflow https://stackoverflow.com/questions/19483380

  •  01-07-2022
  •  | 
  •  

Domanda

I would assign a name for every circle in a Venn diagram. I have tried to change options in category but seems this is the only set I can use. I attach my code, please where is the wrong part?

         goterm3 = c(1,2,3,4,5,6)
         goterm2 =c(2,2,3,4,3,5)
        goterm1=c(4,5,3,2,4,3,2,4)
      int12 = intersect(goterm1, goterm2)
    int13 = intersect(goterm1, goterm3)
    int23 = intersect(goterm2, goterm3) 
    intall = intersect(int12, goterm3)
    require(VennDiagram)

      venn.plot =  draw.triple.venn(length(goterm1), length(goterm2), length(goterm3),
       length(int12), length(int23), length(int13),length(intall),
 category = rep("ORG1, ORG2,Org",3) ,rotation = 1, reverse = FALSE, euler.d =    FALSE,
      scaled = FALSE, lwd = rep(2, 3), lty = rep("solid", 3),
      col = rep("black", 3), fill = c("blue", "red", "green"),
      alpha = rep(0.5, 3),
     label.col = rep("black", 7), cex = rep(1, 7), fontface = rep("plain", 7),
      fontfamily = rep("serif", 7), cat.pos = c(0, 0, 180),
      cat.dist = c(0.05, 0.05, 0.025), cat.col = rep("black", 3),
      cat.cex = rep(1, 3), cat.fontface = rep("plain", 3),
      cat.fontfamily = rep("serif", 3),
      cat.just = list(c(0.5, 1), c(0.5, 1), c(0.5, 0)), cat.default.pos = "outer",
      cat.prompts = FALSE, rotation.degree = 0, rotation.centre = c(0.5, 0.5),
      ind = TRUE, sep.dist = 0.05, offset = 0)
È stato utile?

Soluzione

This is what I get and it does have the same labels as your categories (after I unmangled the string values for the categories:

  category = c("ORG1", "ORG2","Org") # no rep needed and proper quotes 

enter image description here

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top