Rev 59040 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/grDevices/man/unix/png.Rd% Part of the R package, http://www.R-project.org% Copyright 1995-2011 R Core Team% Distributed under GPL 2 or later\name{cairo}\alias{svg}\alias{cairo_pdf}\alias{cairo_ps}\title{Cairo-based SVG, PDF and PostScript Graphics Devices}\description{Graphics devices for SVG, PDF and PostScript graphics files.}\usage{svg(filename = if(onefile) "Rplots.svg" else "Rplot\%03d.svg",width = 7, height = 7, pointsize = 12,onefile = FALSE, family = "sans", bg = "white",antialias = c("default", "none", "gray", "subpixel"))cairo_pdf(filename = if(onefile) "Rplots.pdf" else "Rplot\%03d.pdf",width = 7, height = 7, pointsize = 12,onefile = FALSE, family = "sans", bg = "white",antialias = c("default", "none", "gray", "subpixel"))cairo_ps(filename = if(onefile) "Rplots.ps" else "Rplot\%03d.ps",width = 7, height = 7, pointsize = 12,onefile = FALSE, family = "sans", bg = "white",antialias = c("default", "none", "gray", "subpixel"))}\arguments{\item{filename}{the name of the output file.The page number is substituted if a C integer format is included inthe character string, as in the default. (The result must be lessthan \code{PATH_MAX} characters long, and may be truncated if not.See \code{\link{postscript}} for further details.) Tilde expansionis performed where supported by the platform.}\item{width}{the width of the device in inches.}\item{height}{the height of the device in inches.}\item{pointsize}{the default pointsize of plotted text (in big points).}\item{onefile}{should all plots appear in one file or in separate files?}\item{family}{one of the device-independent font families,\code{"sans"}, \code{"serif"} and \code{"mono"}, or a characterstring specify a font family to be searched for in asystem-dependent way.#ifdef unixSee, the \sQuote{Cairo fonts} section in the help for \code{\link{X11}}.#endif}\item{bg}{the initial background colour: can be overridden by settingpar("bg").}\item{antialias}{string, the type of anti-aliasing (if any) to be used;defaults to \code{"default"}.}}\details{SVG (Scalar Vector Graphics) is a W3C standard for vector graphics.See \url{http://www.w3.org/Graphics/SVG/}. The output is SVG version1.1 for \code{onefile = FALSE} (the default), otherwise SVG 1.2. (Very fewSVG viewers are capable of displaying multi-page SVG files.) Althoughthis only requires cairo >= 1.2, the output produced by cairo 1.2.4(in Centos/RHEL 5) is incorrect.Note that unlike \code{\link{postscript}} and \code{\link{pdf}},\code{cairo_pdf} and \code{cairo_ps} sometimes record \emph{bitmaps}and not vector graphics: a resolution of 72dpi is used. On the otherhand, they can (on suitable platforms) include a much wider range ofUTF-8 glyphs, and embed the fonts used.The output produced by \code{cairo_ps(onefile = FALSE)} will beencapsulated postscript on a platform with cairo >= 1.6.\R can be compiled without support for any of thesedevices: this will be reported if you attempt to use them on a systemwhere they are not supported. They all require cairo version 1.2 orlater.If you plot more than one page on one of these devices and do notinclude something like \code{\%d} for the sequence number in\code{file} (or set \code{onefile = TRUE}) the file will contain thelast page plotted.There is full support of transparency, but using this is one of thethings liable to trigger bitmap output (and will always do so for\code{cairo_ps}).}\value{A plot device is opened: nothing is returned to the \R interpreter.}\seealso{\code{\link{Devices}}, \code{\link{dev.print}}, \code{\link{pdf}},\code{\link{postscript}}\code{\link{capabilities}} to see if cairo is supported.}\section{Anti-aliasing}{Anti-aliasing is applied to both graphics and fonts. It is generallypreferable for lines and text, but can lead to undesirable effects forfills, e.g. for \code{\link{image}} plots, and so is never used forfills.\code{antialias = "default"} is in principle platform-dependent, butseems most often equivalent to \code{antialias = "gray"}.}\section{Conventions}{This section describes the implementation of the conventions forgraphics devices set out in the \dQuote{R Internals Manual}.\itemize{\item The default device size is in pixels (\code{svg}) or inches.\item Font sizes are in big points.\item The default font family is Helvetica.\item Line widths are multiples of 1/96 inch.\item Circle radii have a minimum of 1/72 inch.\item Colours are interpreted by the viewing application.}}\keyword{device}