Print the Current Plot

DESCRIPTION:
Makes a hard copy of the current plot when using certain graphics drivers.

USAGE:
printgraph(horizontal=<<see below>>,
            print=<<see below>>, dpi=<<see below>>, paper=<<see below>>,
            method=<<see below>>, command=<<see below>>,
            file=<<see below>>, tempfile=<<see below>>, maximize=T,
            width=<<see below>>, height=<<see below>)

OPTIONAL ARGUMENTS:
horizontal:
if TRUE, the x axis will lie along the long side of the paper ("landscape" mode); if FALSE, the long side is vertical ("portrait" mode). The default is specified in the environment variable S_PRINT_ORIENTATION (as either landscape or portrait).
print:
if FALSE, printgraph will not send temporary files to the printer via command. The default value is FALSE when either file or tempfile are specified. The default is TRUE when neither file nor tempfile are specified.
dpi:
the line resolution for LaserJet output files, in dots per inch. Acceptable values are 75, 100, 150, and 300. The default is specified by the environment variable S_LASERJET_DPI.
paper:
character string indicating the size of the paper loaded into the printer. The values accepted for paper are dependent on the underlying driver. The values "letter", "legal" and "a4" accepted by both "laserjet" and "postscript" drivers. The default is "letter" for "laserjet" and as specified by ps.options()$paper for "postscript".
method:
a character string indicating the type of printer for which the output file is being written. Acceptable printer types are "laserjet" and "postscript". The default method is specified by the environment variable S_PRINTGRAPH_METHOD. This, as well as other printgraph defaults, may be specified before entering S-PLUS (e.g., setenv S_PRINTGRAPH_METHOD laserjet).
command:
a character string naming a UNIX command. If print is TRUE, the plot output will be sent as an argument to command. The default command for LaserJet is in the S_LASERJET_PRINT_COMMAND environment variable, and that for PostScript is in S_POSTSCRIPT_PRINT_COMMAND.
file:
a character string naming a file to write the plot output to. If not supplied, the tempfile option will determine the output filename.
tempfile:
character string to be used as a template for naming a file where the PostScript commands are to go. The first sequence of "#" characters will be replaced with a number in the generated filenames. The default value is dependent on the underlying driver. For the "laserjet" driver, the default value is "lj.out.####.lj". For the "postscript" driver, the default is determined by the ps.options function.
maximize:
logical flag: if TRUE, the page is used to the fullest (reasonable) extent.
width:
width of the plotting region in inches. width refers to the x axis dimension. The default values for width and height depend on the size of the plotting region of the currently active device.
height:
height of plotting region in inches. height refers to the y axis dimension.

SIDE EFFECTS:
the current plot on your graphics terminal will be printed on a PostScript language or Hewlett-Packard LaserJet laser printer, or a file will be created or appended.

DETAILS:
To see the current default values of any of the printgraph environment variables, use the getenv command while in S-PLUS:

getenv("S_PRINTGRAPH_METHOD") getenv("S_PRINT_ORIENTATION") etc...

Please refer to "Customizing your S-PLUS Session" in the S-PLUS User's Manual, for a full discussion of using environment variables to change printgraph defaults.

Since not all S-PLUS graphics devices have the printgraph capability, you will see a message about a "pipe error" if you run printgraph with a graphics device which does not understand it. If this occurs, the best solution is to leave S-PLUS and start it up again from scratch. See the Devices help file for a list of graphics devices that understand printgraph. An alternative is to use the dev.print function.


SEE ALSO:
dev.copy , postscript , ps.options , hplj , Devices , getenv .

EXAMPLES:
tek12()
usa()
printgraph()
  # ... now walk over to the printer to pick it up ...
contour(interp(state.center$x, state.center$y, state.x77[,2]))
printgraph()
  # ... now walk over to the printer to pick it up ...