Save the current page of a cairo
X11() device to a file.
savePlot(filename = paste("Rplot", type, sep="."), type = c("png", "jpeg", "tiff", "bmp"), device = dev.cur())
- filename to save to.
- file type: only
"png"will be accepted for cairo version 1.0.
- the device to save from.
X11 devices of types
"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.
There is a similar function of the same name but more types for
windows devices on Windows.
Documentation reproduced from R 2.12.1. License: GPL-2.