pdf.graph(file, horizontal = F, width = 0, height = 0, pointsize = 14, font = 1, 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.page, object, command)
object
and
command
arguments.
TRUE
make picture in landscape orientation, otherwise in portrait.
paper
argument instead of
(or in addition to)
width
and
height
.
par("cex")
is 1.
color
is
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.
The 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
pdf.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.
colormap
for filled polygon colors.
This argument is ignored unless either
use.device.palette(TRUE)
or
use.legacy.graphics(TRUE)
has been called.
colormap
for line colors.
This argument is ignored unless either
use.device.palette(TRUE)
or
use.legacy.graphics(TRUE)
has been called.
colormap
for image colors.
Typically,
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.
c(0,0,paper[1],paper[2])
, after
paper
has been converted
to inches.
"letter"
,
"legal"
,
"A"
,
"B"
, or
"C"
.
The order of the dimensions is not relevant:
the
horizontal
argument determines which is the
width; if
horizontal=TRUE
then the
horizontal dimension is larger.
The default, given by the dataset
pdf.paper
, is
"letter"
.
You cannot view the output file until you call
dev.off
to close the device driver.
You can use this device with Trellis Graphics by starting the
device with
trellis.device(pdf.graph, file="my.pdf")
.
The fonts available are
( 1) Helvetica ( 2) Courier ( 3) Times-Roman ( 4) Helvetica-Oblique ( 5) Helvetica-Bold ( 6) Helvetica-BoldOblique ( 7) Courier-Oblique ( 8) Courier-Bold ( 9) Courier-BoldOblique (10) Times-Italic (11) Times-Bold (12) Times-BoldItalic (13) Symbol (14) AvantGarde-Book (15) AvantGarde-BookOblique (16) AvantGarde-Demi (17) AvantGarde-DemiOblique (18) Bookman-Demi (19) Bookman-DemiItalic (20) Bookman-Light (21) Bookman-LightItalic (22) Helvetica-Narrow (23) Helvetica-Narrow-Bold (24) Helvetica-Narrow-BoldOblique (25) Helvetica-Narrow-Oblique (26) NewCenturySchlbk-Roman (27) NewCenturySchlbk-Bold (28) NewCenturySchlbk-Italic (29) NewCenturySchlbk-BoldItalic (30) Palatino-Roman (31) Palatino-Bold (32) Palatino-Italic (33) Palatino-BoldItalic (34) ZapfChancery-MediumItalic (35) ZapfDingbats
pch=0:18
are made
with characters from the Symbol and ZapfDingbats fonts.
They don't look exactly like the marks described in the
points
help file, but resemble them when possible.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 (or RGBA) values or color names. An RGBA value is a hexadecimal
representation of color where the red,
green, blue, and alpha channel, or transparency, values are specified.
The
pdf.graph
device supports color transparency.
In order to use device specific color schemes, make one of these calls
before calling
postscript
:
use.device.palette(TRUE) use.legacy.graphics(TRUE)For more information on color specification, see the chapter "Graphics Enhancements" in the Guide to Graphics.
If either
use.device.palette(TRUE)
or
use.legacy.graphics(TRUE)
has been called, and
if
col
is a fraction between 0 and 1,
pdf.graph()
will render that as a blend
of the background color (
col=0
) and
the first line color. Not all graphics devices do this.
Adobe Systems, Inc. (1993).
Portable Document Format Reference Manual.
Addison-Wesley, Reading, Massachusetts.
Adobe website:
http://www.adobe.com
pdf.graph(file="test.pdf") 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 Adobe Acrobat Reader, perhaps as a web browser plug-in, # to view "test.pdf". On Unix with Adobe's acroread you can # use the following to send it to the viewer: unix(paste("acroread -name acroread -useFrontEndProgram", "test.pdf", "&"), out=F)