This help topic is for R version 2.9.0. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/grDevices/html/savePlot.html
savePlot {grDevices}R Documentation

Save Cairo X11 Plot to File

Description

Save the current page of a cairo X11() device to a file.

Usage

savePlot(filename = paste("Rplot", type, sep="."),
         type = c("png", "jpeg", "tiff", "bmp"),
         device = dev.cur())

Arguments

filename

filename to save to.

type

file type: only "png" will be accepted for cairo version 1.0.

device

the device to save from.

Details

Only X11 devices of types "cairo" and "nbcairo" are supported.

This works by copying the image surface to a file. For PNG will always be a 24-bit per pixel PNG ‘DirectClass’ file, for JPEG the quality is 75% and for TIFF there is no compression.

At present the plot is saved after rendering onto the canvas (default opaque white), so for the default bg = "transparent" the effective background colour is the canvas colour.

Value

Invisible NULL.

Note

There is a similar function of the same name but fewer types for cairo-based X11 devices on Unix-alikes

See Also

X11, dev.copy, dev.print


[Package grDevices version 2.9.0 ]