{grDevices}R Documentation

Control Multiple Devices


These functions provide control over multiple graphics devices.

Only one device is the active device. This is the device in which all graphics operations occur.

Devices are associated with a name (e.g., "X11" or "postscript") and a number; the "null device" is always device 1. shuts down the specified (by default the current) device. shuts down all open graphics devices.

dev.set makes the specified device the active device.


dev.list() = dev.cur())
dev.prev(which = dev.cur()) = dev.cur())
dev.set(which =


which An integer specifying a device number


dev.cur returns the number and name of the active device, or 1, the null device, if none is active.
dev.list returns the numbers of all open devices, except device 1, the null device. This is a numeric vector with a names attribute giving the names, or NULL is there is no open device. and dev.prev return the number and name of the next / previous device in the list of devices. The list is regarded as a circular list, and "null device" will be included only if there are no open devices. returns the name and number of the new active device (after the specified device has been shut down).
dev.set returns the name and number of the new active device.

See Also

Devices, such as postscript, etc.

layout and its links for setting up plotting regions on the current device.


## Not run: 
## Unix-specific example
abline(0,1)# through the 1:10 points
abline(h=0, col="gray")# for the residual plot
dev.set(dev.prev()); close the two X devices
## End(Not run)

[Package grDevices version 2.2.1 Index]