R plot legend with transparent background

Qbik picture Qbik · Apr 29, 2016 · Viewed 17.9k times · Source

How to R plot legend with transparent background when using plot() function ?

Answer

Shicheng Guo picture Shicheng Guo · Aug 16, 2016

Use: bg="transparent" in

legend()

Such as:

legend("right",bg="transparent",col=c(as.numeric(unique(df$group2))),cex=0.5)