powered by
Renders a ggplot object to a PNG file using ragg for high-quality output.
plot_in_png( ggobj = NULL, code = NULL, width, height, res = 200, units = "in", pointsize = 11, scaling = 1, path = NULL )
Character, the path to the created PNG file
A ggplot object to render
Numeric, width of the output image
Numeric, height of the output image
Numeric, resolution in DPI (default 200)
Character, units for width and height ("in", "cm", "mm", "px") (default "in")
Integer, The default pointsize of the device in pt
scaling factor to apply
Character, output file path. If NULL, a temporary file is created (default NULL)
plot_in_png( code = { barplot(1:10) }, width = 5, height = 4, res = 72, units = "in" )
Run the code above in your browser using DataLab