Export plot in .png with transparent background
x = c(1, 2, 3)
par(bg=NA)
plot (x)
dev.copy(png,'myplot.png')
dev.off()
Instead of saving all parameters, it is better to only save the old value of the parameter that was changed in a call to ´par´ by saving result of ´par´ as in the modified example:
x = c(1, 2, 3)
old.par <- par(bg=NA)
plot (x)
dev.copy(png,'myplot.png')
dev.off()
par(old.par)