I was generating a venn diagram with label using the code as below:
v <- venn.diagram(list(ISG15=d1, USP18=d2),
fill = c("orange", "blue"),
alpha = c(0.5, 0.5), cat.cex = 3, cex=1.5,
filename=NULL)
# have a look at the default plot
grid.newpage()
grid.draw(v)
# have a look at the names in the plot object v
lapply(v, names)
# We are interested in the labels
lapply(v, function(i) i$label)
# Over-write labels (5 to 7 chosen by manual check of labels)
# in foo only
v[[5]]$label <- paste(setdiff(d1, d2), collapse="\n")
# in baa only
v[[6]]$label <- paste(setdiff(d2, d1) , collapse="\n")
# intesection
v[[7]]$label <- paste(intersect(d1, d2), collapse="\n")
Ideally I assume d1 (ISG15 in my dataset) will be on the left side, and d2 (UPS18) on the right. But actually d2 is on the left side, which cause my label mismatched. I don't understand the reason (probably because d1 has 25 element and d2 has 21 element? I don't know). Did I miss sth there?
But