I am trying to export a simple plot in .png with transparent background. I am able to export it, but the background stays white.
Mock example
x = c(1, 2, 3)
I've tried this
plot (x)
dev.copy (png,'myplot.png', bg = 'transparent')
dev.off()
And this
plot (x, bg = 'transparent')
dev.copy (png,'myplot.png')
dev.off()
But neither work.
Can someone help?
png("myplot.png", width=600, height=400, bg = "transparent"); plot(x); dev.off()
– Psychometricsplot (x, bg = 'transparent'); dev.copy (png,'myplot.png', bg = 'transparent')
– Rattler