powered by
Converts object to PNG. By default, device is scaled by plot size. Device is automatically closed and filename argument is returned.
# S3 method for default as.png(x, width = getOption("plotscale_png_width", 3), height = getOption("plotscale_png_height", 3), devsize = if (scaled) "devsize" else "unscaled", res = getOption("plotscale_res", 300), units = "in", scaled = getOption("plotscale_scaled", TRUE), filename = "Rplot%03d.png", ...)
object
desired plot width
desired plot height
a function of x, width, height, and … that calculates device size
passed to png
png
NOT passed to png; width and height always treated as inches regardless
whether to rescale width and height by plot size
file name passed to png
other arguments to png and devsize
(invisible) the filename argument
Other as.png: as.png
as.png
Other devices: as.pdf.default, as.pdf, as.png
as.pdf.default
as.pdf
# NOT RUN { options(example.ask = FALSE) options(device.ask.default = FALSE) library(lattice) as.png(xyplot(2~3), filename = tempfile()) # }
Run the code above in your browser using DataLab