\Header{postscript}{PostScript Graphics}
\alias{ps.options}{postscript}
\alias{.PostScript.Options}{postscript}
\keyword{device}{postscript}
\begin{Usage}
\begin{verbatim}
postscript(file = "Rplots.ps", ...)
ps.options(..., reset = FALSE, override.check = FALSE)
.PostScript.Options
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\texttt{file}] a character string giving the name of the file to print to.
\item[\texttt{...}] further options for \texttt{postscript()}.
\item[\texttt{paper}] the size of paper in the printer.  The choices are
\texttt{"a4"}, \texttt{"letter"}, \texttt{"legal"} and \texttt{"executive"}.
\item[\texttt{horizontal}] the orientation of the printed image, a logical.
\item[\texttt{width,height}] the width, and height of the graphics region in inches.
The default is to use the entire page.
\item[\texttt{family}] the font family to be used.
This must be one of \texttt{"AvantGarde"},
\texttt{"Bookman"}, \texttt{"Courier"}, \texttt{"Helvetica"},
\texttt{"Helvetica-Narrow"}, \texttt{"NewCenturySchoolbook"},
\texttt{"Palatino"} or \texttt{"Times"}.
\item[\texttt{pointsize}] the default point size to be used.
\item[\texttt{bg}] the default background color to be used.
\item[\texttt{fg}] the default foreground color to be used.
\item[\texttt{onefile, print.it, append}] logical; are currently \bold{all
disregarded}; just there for compatibility reasons.
\end{ldescription}
\end{Arguments}
\begin{Description}
\texttt{postscript} starts the graphics device driver for producing
PostScript graphics.
The auxiliary function \texttt{ps.options} can be used to set and view
(if called without arguments)
default values for the arguments to \texttt{postscript}.\end{Description}
\begin{Details}
\texttt{postscript(..)} opens the file \texttt{file} and the
PostScript commands needed to plot any graphics requested are
stored in that file.
This file can then be printed on a suitable device to obtain hard copy.

The postscript produced by \R\ is EPS (\emph{Encapsulated PostScript})
compatible, and can be included into other documents, e.g. into LaTeX, using
\texttt{\\epsfig\{file=<filename>\}}.\end{Details}
\begin{SeeAlso}
\texttt{\Link{x11}}, \texttt{\Link{macintosh}}, \texttt{\Link{Devices}}.
{\texttt{\Link{check.options}} which is called from both
\texttt{ps.options} and \texttt{postscript}.}\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}

 # open the file "foo.ps" for graphics output
 postscript("foo.ps")



 # open the file "foo.ps" for graphics output
 postscript("foo.ps")


dev.off()		# turn off the postscript device

all(unlist(ps.options()) == unlist(.PostScript.Options))
ps.options(bg = "pink")
str(ps.options(reset = TRUE))

##- error checking of arguments:
ps.options(width=0:12, onefile=0, bg=pi)

## override the check for 'onefile', but not the others:
str(ps.options(width=0:12, onefile=1, bg=pi, override.check = c(F,T,F)))

dev.off()		# turn off the postscript device

all(unlist(ps.options()) == unlist(.PostScript.Options))
ps.options(bg = "pink")
str(ps.options(reset = TRUE))

##- error checking of arguments:
ps.options(width=0:12, onefile=0, bg=pi)

## override the check for 'onefile', but not the others:
str(ps.options(width=0:12, onefile=1, bg=pi, override.check = c(F,T,F)))
\end{ExampleCode}
\end{Examples}

