Control Multiple Graphics Devices

DESCRIPTION:
Manipulate multiple graphics devices: display information about each, change the current device, or turn off a graphics device. These functions are only useful when you start more than one graphics device at a time.

USAGE:
dev.cur()
dev.list()
dev.next(which = dev.cur())
dev.prev(which = dev.cur())
dev.off(which = dev.cur())
dev.set(which = dev.next())

OPTIONAL ARGUMENTS:
which:
An integer specifying an active device.

VALUE:
dev.cur returns the number and name of the graphics device currently accepting graphics commands.

dev.list returns the number and name of all active devices.

dev.next returns the number and name of the graphics device next on the list of active graphics devices.

dev.prev return the number and name of the graphics device previous to the current device on the list of active graphics devices.

dev.set returns the number and name of the (newly) current graphics device. (This may not be the one you asked for if which does not refer to an active device.)

dev.off returns the number of the current device after device which was shutdown.


SIDE EFFECTS:
dev.set changes the current graphics device to the one given by which, or to the next device after which if which is not active.

dev.off turns off the graphics device given by which.


NOTE:
Graphics device number 1 ("null device") always exists, and these graphics functions may return it if no graphics devices are active.

DETAILS:
There are two objects in the session database called .Device and .Devices which are used to keep track of the current and active devices.

BACKGROUND:
A device is "active" if it has been started but not turned off. The "current" device is that device which will receive the graphics commands.

SEE ALSO:
Devices , dev.copy , graphics.off

EXAMPLES:
motif()
plot(x <- sort(rnorm(100)))
motif()
plot(y <- sort(rnorm(100)))
dev.set(dev.prev())
abline(lsfit(1:100, x))
dev.set(dev.next())
abline(lsfit(1:100, y))
names(dev.list())