Opens a new device

Opens a new device.

utilities, device
devNew(type=getOption("device"), ..., scale=1, aspectRatio=1, par=NULL, label=NULL)
A character string specifying the type of device to be opened. This string should match the name of an existing device function.
Additional arguments passed to the device function, e.g. width and height. If not given, the are inferred from devOptions
A numeric scalar factor specifying how much the width and the height should be rescaled.
A numeric ratio specifying the aspect ratio of the image. See below.
An optional named list of graphical settings applied, that is, passed to par, immediately after opening the device.
An optional character string specifying the label of the opened device.

  • Returns what the device function returns.

Width and heights

The default width and height of the generated image is specific to the type of device used. There is not straightforward programatical way to infer these defaults; here we use devOptions(), which in most cases returns the correct defaults.

Aspect ratio

The aspect ratio of an image is the height relative to the width. If argument height is not given (or NULL), it is calculated as aspectRatio*width as long as they are given. Likewise, if argument width is not given (or NULL), it is calculated as width/aspectRatio as long as they are given. If neither width nor height is given, then width defaults to devOptions(type)$width. If both width and height are given, then aspectRatio is ignored.

See Also

devDone() and devOff(). For simplified generation of image files, see devEval().

  • devNew
Documentation reproduced from package R.utils, version 1.12.0, License: LGPL (>= 2.1)

Community examples

Looks like there are no examples yet.