next up previous contents index
Next: The iplot Command Up: Graphical Output Commands Previous: The combine Command   Contents   Index


The hardcopy Command

The hardcopy command is used to generate hardcopy plots of simulation data on a printer or plotter. This capability is similar to the Print button which appears on each of the on-screen plots from the plot command.

hardcopy [setupargs] plotargs
setupargs: -d driver -c command -f filename -r resolution -w width -h height
-x left_marg -y top_marg -l
This command uses the internal hardcopy drivers to generate a hard copy of the vectors and expressions given in plotargs. The plotargs are vectors or expressions to be plotted, as with the plot command. If no plotargs are provided, the arguments are taken to be the same as those given to the last plotting command given (these include plot, asciiplot, hardcopy, and xgraph). The setupargs override the current values established using the set command or the Plot Options tool in the Tools menu, and default to the driver defaults if not specified either way.

The -d driver specifies the name of a hardcopy driver using one of the keywords known to the hcopydriver variable. If the -d option is not specified, the hcopydriver variable will be used if set. If no driver is set, or set to an unrecognized driver name, the hardcopy is aborted.

The -c command option specifies the operating system command used to send the job to the printer, and overrides the value of the hcopycommand variable, which is otherwise used if set. The value is a string (which must be quoted it it contains space), where the characters ``%s'' are replaced by the name of the (possibly temporary) file used to store the plot data. If no %s appears, the file name is appended to the end of the command string. In BSD Unix, the command string might be ``lpr -h -Pmyprinter'', for example. See the man page for the print command on your machine for more information. If there is no command string given using the -c option and hcopycommand is undefined, the data will be saved in a file, but not printed.

The -f filename option gives a file name to store the plot data. There is no analogous ``set'' variable. If given, the plot will be saved in the file, and not sent to the printer.

The -r resolution command will set the printer to use the specified resolution, if that resolution is supported by the driver and the printer. If not given, the value of hcopyresol is used, if set, otherwise the driver default is used. The default is almost always the best choice.

The -w width and -h height options set the size of the image as it would appear on a portrait-oriented page. The numbers given represent inches, unless followed by ``cm'' which indicates centimeters. If these options are not given, the hcopywidth and hcopyheight variables are used if set, otherwise the driver defaults are used.

The -x xoffset and -y yoffset options control the position of the image on the page, as defined in portrait orientation. The yoffset may be measured from the top or bottom of the page, depending upon the driver. These values default to those in the variables hcopyxoff and hcopyyoff if set, otherwise driver defaults are used. The numbers represent inches, unless followed by ``cm'' indicating centimeters.

If the -l option is given, or the hcopylandscape variable is set, the image will be rotated and printed in landscape orientation.

The variables which control plot presentation also control the presentation of the hardcopy (see 4.8.6). The hardcopy command is suited for use in scripts. For general plotting, the Print button in the plot windows brings up a panel which provides a superior user interface.


next up previous contents index
Next: The iplot Command Up: Graphical Output Commands Previous: The combine Command   Contents   Index
Stephen R. Whiteley 2024-10-26