Different plot device options
PNG
curve(sin(x)/exp(x/50),0,50)
HTMLon()
showgraph()
PDF
pdf(file="example.pdf", width=5, height=5,
pointsize=10)
curve(sin(x)/exp(x/50),0,50)
dev.off()
HTMLon()
HTMLembed('example.pdf',width=300,height=300)
PDF fullscreen
(This gets rid of the Acrobat buttons but is messy)
mypdf <- function(file="Rplot.pdf",width=4,height=4,...) {
gsexe <- Sys.getenv("R_GSCMD")
if (is.null(gsexe) || nchar(gsexe) == 0) gsexe <- "gs"
res=300;
cmd <- paste("|", gsexe, " -dNOPAUSE -dBATCH -q
-sDEVICE=pdfwrite -dAutoRotatePages=/None -sOutputFile=",
file, " -r", res, " -g", ceiling(res * width), "x", ceiling(res *
height),
" -c [ /PageMode /FullScreen /DOCVIEW pdfmark
-",
sep = "")
postscript(file = cmd, paper = "special", width=width,
height=height, horizontal = FALSE, ...)
}
mypdf(file="example_full_screen.pdf", width=3, height=3,
pointsize=10)
curve(sin(x)/exp(x/50),0,50)
dev.off()
HTMLon()
HTMLembed('example_full_screen.pdf',width=300,height=300)
SVG
Needs an extra driver from CRAN [link] and a browser with the
Adobe SVG plugin or native SVG capability
require(RSvgDevice)
devSVG(file="example.svg", width=4, height=4)
curve(sin(x)/exp(x/50),0,50)
dev.off()
HTMLon()
HTMLembed('example.svg',width=300,height=300)
by Tom Short, tshort@epri.com, Copyright
2004 EPRI, license: GNU GPL v2 or greater