Graphics Device for Any Terminal

DESCRIPTION:

Allows graphics to be produced on any terminal. The plots are crude, but this device works under the widest set of situations.

USAGE:

printer(width=80, height=64, file="", command="") 

OPTIONAL ARGUMENTS:

width
the width, in characters, of the output device.
height
the height, in characters, of the output device.
file
character string giving a file name. If specified, all graphical output will be sent to this file.
command
character string giving a UNIX command. If specified, the output of the printer driver will be piped into the command. This is most frequently used to pipe output directly into a line printer spooler.

SIDE EFFECTS:

printer initializes a graphics device that allows low resolution graphics to be produced.

DETAILS:

Each plot is stored in an internal buffer. This enables functions to be given to add to the existing plot. When the next plot is started, the previous plot is printed. To plot a single plot, use dev.off to close the device and display the plot.

The printer device is a primitive, low resolution device. Its primary justification is that it enables you to do some sort of graphics on arbitrary non-graphics terminals. It does not support line style changes, character size changes, character rotation or color.

Graphic input ( locator, identify) done on this device will prompt for x- and y-coordinates. Type in the desired coordinates or hit carriage return to terminate graphic input.

If several plotted points (not lines) overwrite each other, the overwritten position is plotted as a "%" character.

WARNING:

Do not allow two different instances of a graphics device write to the same file. The file will become corrupted if this happens.

SEE ALSO:

, . show.printer() can be used to display the current plot.

EXAMPLES:

printer(command="lp")      # pipe directly to line printer 
# an example plot is given on the next page 
printer(height=35, width=60) 
plot(lottery.number,lottery.payoff) 
show.printer() # show the plot so far
title("Lottery Data")   # now add title to it 
dev.off() 
                          Lottery Data 
       .................................................. 
       .                       * 
       . 
   800.. 
       .                                   * 
       . 
 l     . 
 o     .  * 
 t     .    *                                     * 
 t 600.. 
 e     .     *                        * *   *    * 
 r     .  *          *       *                 * * 
 y     . *  **    *               * *   * *          * 
 .     . *   *              * * *  *  *              ** 
 p     .   * *              *         * 
 a 400.. ****         *   *     * *    *     * ****** 
 y     . *  *     *     *  *  *       **  *   * *  *** 
 o     . *  *       * * *  **           *         *** 
 f     . *     ** ** *    *   ** * ** * *  **  **   ** 
 f     .      *  * *  *       ***   *** *  * * *  *  ** 
       . *    * ********  * *   *          ** **  * * 
   200..     ****  *** *** * ** **  *     ** * 
       .      * * **** *** *    **        **      * 
       .     ****  ** **** **   * *      *        * 
       . *    * 
       .................................................. 
         0       200      400      600      800     1000 
                         lottery.number