Device drivers



next up previous contents
Next: PostScript diagrams for Up: Graphical procedures Previous: Multiple figure environment

Device drivers

S can generate graphics (of varying levels of quality) on almost any type of display or printing device. Before this can begin, however, S needs to be informed what type of device it is dealing with. This is done by starting a device driver. The purpose of a device driver is to convert graphical instructions from S (`draw a line,' for example) into a form that the particular device can understand.

Device drivers are started by calling a device driver function. There is one such function for every device driver: type help(Devices) for a list of them all. For example, issuing the command

postscript()

causes all future graphics output to be sent to the printer in PostScript format. Some commonly-used device drivers are:


motif()
openlook()
X11()

For use with the X11 or Open Windows window systems.


suntools()

For use with the SunView windowing system.


postscript()

For printing on PostScript printers, or creating PostScript graphics files.


printer()
crt()

For terminals with little or no graphics capabilities. ASCII-based graphics are generated.


When you have finished with a device, be sure to terminate the device driver by issuing the command

dev.off()

This ensures that the device finishes cleanly; for example in the case of hardcopy devices this ensures that every page is completed and has been sent to the printer.





Erik Moledor
Tue Jan 31 21:02:18 EST 1995