postscript
function and PostScript
driver embedded in other drivers.
ps.options (..., reset=F)
name=value
form, or no argument at all may be given. See the VALUE and SIDE
EFFECTS sections for explanations.
TRUE
, the
copy of the options list stored on the session database (frame 0) will be
removed. That copy of the options list is made whenever
ps.options
is used
to set the value of a component of the options list. Removing that copy has
the effect of resetting the options list to its default value (as stored in
the default
search()
list). The default for this option is
FALSE
.
What follows is a listing of frequently used options. For a complete listing
of all available options, refer to the
ps.options.send
help file.
background
is a
single positive integer, it is treated as an index into the
colors
argument.
If it is a negative number, then there is no background. Otherwise, it is
assumed to be a single explicit color specification as in the
colors
argument. The default is
-1
(no background).
setcolor
specification, there are two possibilities.
If
colors
is a vector, it is
used to define gray levels (0=black to 1=white) beginning with
color number 1.
If
colors
is a 3-column matrix, it is used to define colors
in the RGB model (see the PostScript Language Reference Manual),
one per row, beginning with color number 1.
ps.colors.rgb
can be subsetted to provide a value for this
argument. Also, the function
ps.hsb2rgb
can be used to convert colors from
the HSB model to the RGB model equivalents. See the examples section below.
command
string. If
command
is an empty string, printing will be disabled.
fonts
).
A negative number will select the font in its outline form. The default value
is
1
to pick the 1st font in
fonts
.
i
will be the
i
-th font named in this vector.
height
refers to the y axis dimension.
TRUE
, plots are in landscape mode (x axis is along the
longer edge of the paper). Otherwise, plots are in portrait mode.
image
function. Refer to the
colors
component for specification details.
TRUE
, the page is used to the fullest (reasonable) extent.
If
FALSE
, the PostScript output will try to match the actual size of the plot.
The aspect ratio (or relative proportions) of the plot is maintained in either case.
paper
are
"letter"
,
"legal"
or
"a4"
.
Most standard ANSI and ISO paper sizes are accepted. This is used to determine the
"imageable region" area of the paper. This argument, along with the
ps.paper.regions
dataset, will determine the default value for the
region
argument. The default for this may be either
"letter"
or
"a4"
depending on
the local setup.
cex
is equal to 1, text will
appear in this size. The default value is 14 points.
If you are creating small figures, you may want to specify a smaller
point size.
paper
argument and the
ps.paper.regions
dataset.
ps.paper.regions
documentation for a way to discover the
imageable region of your printer.
ps.setfont.std
and
ps.setfont.latin1
datasets. The
default is to use the
ps.setfont.latin1
dataset.
This is the ISO 8859-1 (Western European) encoding with the addition of
the bullet character at position 200 (octal) and with the nonstandard fonts
"Symbol", "ZapfDingbats", and "ZapfChancery-MediumItalic" left in their
usual encoding.
"ps.out.####.ps"
will be
"ps.out.0001.ps"
.
%%Title:
header in the
PostScript output. The default value is the string "Spotfire S+ Graphics". This
can be used to help keep track of what is contained within each PostScript
output file.
width
refers to the x axis
dimension. The default values for
width
and
height
are determined by
region
, and need to be smaller than the width and height of the imageable
region described by
region
.
ps.options
changes a list named
.PostScript.Options
in the session database (frame 0). The components of
.PostScript.Options
are
all the currently defined options. The
.PostScript.Options
dataset is placed
on frame 0 the first time a value is set via
ps.options
. The copy of the
dataset on frame 0 can be removed with the
reset
argument.
ps.options
is called with either a list as the single argument, or with
one or more arguments in the
name=value
form, then options specified by the
names in the argument(s) are changed or created.
This function is also used by devices supporting
printgraph
to get the
current options for their embedded PostScript printer driver on startup. When
its values are needed for use during device initialization, the command
lapply(ps.options(),eval)
is used to get the current values. This allows for
the use of dynamically determined expressions in the
ps.options
list (e.g.
get the value of an environment variable).
Note that there are several options in the
ps.options
list that are not
intended to be changed unless you understand the workings of the devices and
PostScript. All available options are documented in
ps.options.send
, but
changing some of them can be hazardous to your output and/or printer setup.
Some printer driving software may have an option to reverse the order of the
pages being output to the printer. In that case, the software needs to
understand the DSC headers that are present in the PostScript output. Some
older software may not properly understand the headers at the default value
for the
dsc
option. Using a
ps.options(dsc=2)
may resolve such problems.
Evidence of this sort of problem may be in a log file for the specific printer
in the form of an error message sent back from the printer. The message would
probably be complaining about the usage of an undefined command.
# Use these colors for PostScript on the next device startup. ps.options (colors=ps.colors.rgb[c("red", "green", "blue"),], background=ps.colors.rgb[c("gray"),]) # Use existing HSB color model specifications ps.options.send (colors=ps.hsb2rgb(my.hsb.ps.colors)) ps.options.send (colors=my.hsb.ps.colors, setcolor=ps.setcolor.hsb) # Set colors for the image() function as shades of red ps.options (image.colors=cbind(0:127/127, rep(0,128), rep(0,128)), title="Figure 1.1 [image data]") # Setup for European paper size ps.options (paper="A4") # Reset to S-PLUS default values. ps.options (reset=T)