I'm using the package "VennDiagram" and used it to generate a nice plot. However I need to export it with a transparent background so that I can use it on a poster. Saving it as a .png directly didn't work, and neither did par(bg=NA)
. Any suggestions? I'm also willing to try a different package as my diagram is fairly simple.
Asked
Active
Viewed 588 times
0

Maya Gosztyla
- 97
- 9
-
1See https://stackoverflow.com/questions/43614863/export-plot-in-png-with-transparent-background – Melissa Key Apr 09 '18 at 03:00
-
I tried using par=bg(NA) but it still had a white background. – Maya Gosztyla Apr 09 '18 at 03:10
1 Answers
1
This worked for me: (from Export plot in .png with transparent background.)
library(gplots)
png("~/venn_test.png", bg = 'transparent')
venn(list(A = letters[sample(26, 10)],
B = letters[sample(26, 10)],
C = letters[sample(26, 10)]))
dev.off()

Melissa Key
- 4,476
- 12
- 21
-
Using gplots worked and is also much simpler than VennDiagram. Thanks! – Maya Gosztyla Apr 09 '18 at 04:18