Multiple graphics devices



next up previous contents
Next: S-PLUS: An Introductory Up: Device drivers Previous: PostScript diagrams for

Multiple graphics devices

  In advanced use of S it is often useful to have several graphics devices in use at the one time. Of course only one graphics device can accept graphics commands at any one time, and this is known as the ``current device''. When multiple devices are open, they form a numbered sequence with names giving the kind of device at any position.

The main commands used for operating with multiple devices, and their meanings are as follows:


motif()
postscript()
...

Each new call to a device driver function opens a new graphics device, thus extending by one the device list. This device becomes the current device, to which graphics output will be sent.


dev.list()

Returns the number and name of all active devices. The device at position 1 on the list is always the ``null device'' which does not accept graphics commands at all.


dev.next()
dev.prev()

Returns the number and name of the graphics device next to, or previous to the current device, respectively.


dev.set(which=k)

Can be used to change the current graphics device to the one at position k of the device list. Returns the number and label of the device.


def.off(k)

Terminate the graphics device at point k of the device list. For some devices, such as postscript devices, this will either print the file immediately or correctly complete the file for later printing, depending on how the device was initiated.


dev.copy(device, ..., which=k)
dev.print(device, ..., which=k)

Make a copy of the device k. device is a device function, such as postscript, with extra arguments, if needed, specified by .... dev.print is similar, but the copied device is immediately closed, so that end actions, such as printing hardcopies, are immediately performed. (See also printgraph()).


graphics.off()

Terminate all graphics devices on the list, except the null device.




next up previous contents
Next: S-PLUS: An Introductory Up: Device drivers Previous: PostScript diagrams for



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