. can generate graphics (of varying levels of quality) on almost any type of display or printing device. Before this can begin, however, . 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 . (`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:
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.