The R Project SVN R

Rev

Rev 1343 | Rev 1409 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

\name{dev.xxx}
\title{Control Multiple Devices}
\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())
}
\alias{dev.cur}
\alias{dev.list}
\alias{dev.next}
\alias{dev.prev}
\alias{dev.off}
\alias{dev.set}
\alias{.Device}
\alias{.Devices}

\arguments{
  \item{which}{An integer specifying a device number}
}
\description{
  These functions provide control over multiple graphics devices.

  Only one device is the \emph{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.

  \code{dev.off} shuts down the specified device.

  \code{dev.set} makes the specified device the active device.

  A list of device names is stored in \code{.Devices}.
  The name of the active device is stored in \code{.Device}.
}
\value{
\code{dev.cur} returns the number and name of the active device.

\code{dev.list} returns the numbers and names of all devices.

\code{dev.next} returns the number and name of the next device in the
list of devices.

\code{dev.prev} returns the number and name of the previous device in
the list of devices.

\code{dev.off} returns the name and number of the new active device
(after the specified device has been shut down).

\code{dev.set} returns the name and number of the new active device.
}
\seealso{
\code{\link{Devices}}, such as \code{\link{postscript}}, etc;
\code{\link{graphic.off}()} for closing all devices.
}
\examples{
( dl <- dev.list() ) # the currently open devices..
x11()
plot(1:10)
x11()
plot(rnorm(10))
dev.set(dev.prev())
abline(0,1)# through the 1:10 points
dev.set(dev.next())
abline(h=0, col="gray")# for the residual plot
dev.off(); dev.off()#- close the two X devices
all(dl == dev.list())# The device list as it was...
}
\keyword{device}