How to R plot legend with transparent background when using plot()
function ?
Asked
Active
Viewed 2.4k times
14

Qbik
- 5,885
- 14
- 62
- 93
-
3you can use `bty="n"` inside `legend` – Ananta Apr 29 '16 at 13:26
-
1Note also that `legend` accepts the bg argument, so that you can fill in the background with a different color if desired. – lmo Apr 29 '16 at 14:27
1 Answers
30
Use: bg="transparent" in
legend()
Such as:
legend("right",bg="transparent",col=c(as.numeric(unique(df$group2))),cex=0.5)

Shicheng Guo
- 1,233
- 16
- 19