Search code examples
rdiagramvenn-diagram

How to change the label of "A", "B", "C" e.t.c. in venn (R)


I try to create a Venn Diagram with venn() function in R. It works but I want to be able to define my own labels instead of "A", "B" e.t.c... I don't understand how one do that cause there is no label argument that can be passed to the function.

EDIT: Forgot to say that I use a list of vectors which contain strings...

*EDIT2:

it is the package "venn" from gplots:

library(gplots)

Example code:

variable list_ looks like this:

> list_
[[1]]
[1] "hejsan"   "pelle"    "svanslov"

[[2]]
[1] "kok"   "nalle" "pelle"

and then I do:

venn(list_)

which looks like this:

http://postimage.org/image/wpis8ny2b/deea76ff/


Solution

  • The venn function takes the labels in the plot from the names of the list elements.

    names(list_) <- c("First list", "Second list")
    venn(list_)