wmf.graph(file, horizontal=F, width=7, height=5.4, pointsize=14, fonts=character(0), color=T, colorspec=if(color) pdf.colors else pdf.grays, colormap=colorspec$colormap, text.colors=colorspec$text.colors, polygon.colors=colorspec$polygon.colors, line.colors=colorspec$line.colors, image.colors=colorspec$image.colors, background.color=colorspec$background.color, region=c(0, 0, paper), paper=pdf.paper, command, paint.background=T, line.width.factor=15, text.line.spacing.factor=0.8)
"file####.wmf"
will have numbers,
starting with
0001
, replacing the # signs.
If you do not put any # signs in, numbers, starting with 2 will be
prepended to
"file"
after the first graph.
par("cex")
is 1.
character(0)
) and "Symbol"
(includes Greek letters).
TRUE
use colors,
if
FALSE
use grayscale.
use.device.palette(TRUE)
or
use.legacy.graphics(TRUE)
has been called.
S-PLUS uses a global color palette and global image color palette.
This list contains a colormap and 4 vectors of indices into that colormap,
one vector each for use when drawing lines, text, polygons, and images.
The components must be named
colormap
,
line.colors
,
text.colors
,
polygon.colors
, and
image.colors
.
You may give those components as individual arguments to
wmf.graph
,
if you do they override the corresponding component of colorspec.
See below for their detailed descriptions.
See the datasets
pdf.grays
and
pdf.colors
for examples.
use.device.palette(TRUE)
or
use.legacy.graphics(TRUE)
has been called.
For grayscale, a vector of numbers between 0 (black) and 1 (white). For color, a 3 column by ncolor row matrix of numbers between 0 and 1. Each row represents a color and its entries give the intensity of its red, green, and blue components. (Instead of this matrix you may also use a ncolor long list of 3 long vectors.)
use.device.palette(TRUE)
or
use.legacy.graphics(TRUE)
has been called.
The color in
colormap[text.colors[par("col")]]
(or corresponding row of colormap if it is a matrix)
will be used when drawing text.
Typically,
text.colors
,
line.colors
, and
polygon.colors
will point to contrasting colors.
use.device.palette(TRUE)
or
use.legacy.graphics(TRUE)
has been called.
use.device.palette(TRUE)
or
use.legacy.graphics(TRUE)
has been called.
image.colors
will point to a smoothly changing sequence of colors.
This argument is ignored unless either
use.device.palette(TRUE)
or
use.legacy.graphics(TRUE)
has been called.
S-PLUS uses a global image color palette.
colormap
for background color.
This argument is ignored unless either
use.device.palette(TRUE)
or
use.legacy.graphics(TRUE)
has been called.
Set the background color by calling
par
to
set the
bg
graphics parameter.
TRUE
paint the page in the background
color before rendering any other graphics. Otherwise do not. Painting
the background will cause the graph to obscure anything it is over when
inserted into a document. If you do not paint the background and
the background is a different color than paper (or slide) then
using col=0 to erase things will produce a colored erasure.
par("lwd")*line.width.factor/1000
inches wide.
par("cex")*pointsize/72*text.line.spacing.factor
inches apart.
Reducing
text.line.spacing.factor
or
pointsize
will reduce the default margin
size and increase the size of the default plotting region.
You cannot view the output file until you end a page of graphics, either
with a new
plot()
command or with the
frame()
command.
You can use this device with Trellis Graphics by starting the
device with
trellis.device(wmf.graph, file="t####.wmf")
.
By default, S-PLUS uses a global color palette and global image color palette to map color indices to specific colors. Color arguments can have integer values that map into the color palette, or they can be specified by RGB values or color names. For more information on color specification, see the chapter "Graphics Enhancements" in the Guide to Graphics.
The Windows metafile graph device is for 16-bit Windows applications, whereas the enhanced metafile graph device is for 32-bit Windows applications.
wmf.graph(file="test####.wmf", color=T) par(mfrow=c(2, 1)) pie(rep(1, 20)) plot(state.x77[,"Frost"], state.x77[,"Murder"], type="n") reg <- factor(state.region) for(i in seq(along=levels(reg))) { w <- reg == levels(reg)[i] points(state.x77[w,"Frost"], state.x77[w,"Murder"], pch=i, col=i) } image(voice.five, ylim=c(0, 80)) image.legend(voice.five$z, x=range(voice.five$x), y=c(70,80), cex=.5, mgp=c(3,.25,0)) tsplot(hstart) dev.off() # now use Microsoft Word and use the Insert/Picture menu item # to insert each picture in your document.