Control Multiple Devices
These functions provide control over multiple graphics devices.
1 2 3 4 5 6 7 8
An integer specifying a device number.
arguments to be passed to the device selected.
Do not use the RStudio graphics device even if
specified as the default device: it does not accept arguments such
Only one device is the ‘active’ device: this is the device in
which all graphics operations occur. There is a
which is always open but is really a placeholder: any attempt to use
it will open a new device specified by
Devices are associated with a name (e.g.,
"postscript") and a number in the range 1 to 63; the
"null device" is always device 1. Once a device has been
opened the null device is not considered as a possible active device.
There is a list of open devices, and this is considered as a circular
list not including the null device.
dev.prev select the next open device in the appropriate
direction, unless no device is open.
dev.off shuts down the specified (by default the current)
device. If the current device is shut down and any other devices are
open, the next open device is made current. It is an error to
attempt to shut down device 1.
graphics.off() shuts down all
open graphics devices. Normal termination of a session runs the
internal equivalent of
dev.set makes the specified device the active device. If there
is no device with that number, it is equivalent to
which = 1 it opens a new device and selects that.
dev.new opens a new device. Normally R will open a new device
automatically when needed, but this enables you to open further
devices in a platform-independent way. (For which device is used see
getOption("device").) Note that care is needed with
file-based devices such as
postscript and in that case file names such as
‘Rplots.pdf’, ‘Rplots1.pdf’, ..., ‘Rplots999.pdf’ are
tried in turn. Only named arguments are passed to the device, and
then only if they match the argument list of the device. Even so,
care is needed with the interpretation of e.g.
width, and for
the standard bitmap devices
units = "in", res = 72 is forced if
neither is supplied but both
dev.cur returns a length-one named integer vector giving the
number and name of the active device, or 1, the null device, if none
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 device names, or
there is no open device.
dev.prev return the number and name of the
next / previous device in the list of devices. This will be the null
device if and only if there are no open devices.
dev.off returns the number and name of the new active device
(after the specified device has been shut down).
dev.set returns the number and name of the new active device.
dev.new returns the return value of the device opened, usually
Devices, such as
layout and its links for setting up plotting regions
on the current device.
1 2 3 4 5 6 7 8 9 10 11 12 13
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.