Use the ImageMagick command line to convert the PDF saved by ggplot2 to PNG format with a transparent background and to set the resolution.
ggpng(x, dpi = 600, ...)ggPNG(x, p, dpi = 600, ...)
A file name that does not have a suffix.
The default dpi is 600. You can enhance the dpi value to produce a higher resolution PNG file.
see :ggsave
ggplot2 object
You will get a PNG file with the result drawn by ggplot2.
You need to install ImageMagick! Please check if the ImageMagick is added to the environment variable.
this ggplot2 object will automatically add a theme with a transparent background.