createGraphFile(obj, fileName=NULL, fileType=NULL, trellisDevice=F, verbose=F, ...)
fileType
is missing, the type is
determined by the
fileName
's extension (the characters after
the last period).
trellisDevice=T
, the
trellis.device()
function
is used to invoke the appropriate device, and hence the Trellis colorscheme
is used. Otherwise the standard default color scheme is used.
fileName
.
This utility function provides a consistent way to save a graph to a
variety of different file types. It invokes the appropriate device
for the file type, create the graph, and closes the device. The
devices used are
wmf.graph
for WMF,
pdf.graph
for PDF,
postscript
for PS
and EPS, and
java.graph
for SPJ, JPEG, JPG, TIF, PNG, PNM,
or BMP. Note that
java.graph
requires Java-enabled S-PLUS.
On Windows, Java can be enabled by loading the
winjava
library.
On UNIX, Java can be enabled by using
Splus -j
or
Splus -g
to start S-PLUS.
This function is in the
menu
library.
obj <- xyplot(Mileage~Weight | Type, data=fuel.frame) createGraphFile(obj, fileName="my_xyplot.pdf", fileType="PDF") createGraphFile("image(voice.five)", fileName="my_image.wmf") expr <- expression(example.contour()) createGraphFile(expr, "my_contour.jpg", trellis=T, verbose=T)