RandomFields (version 2.0.71)

Dev: Choosing the device

Description

Dev chooses between the graphical devices screen, postscript and pdf

Usage

Dev(on, dev, ps=NULL, cur.cex=TRUE, paper="special", width=5, height=5,
    quiet=FALSE, innerwidth, innerheight, mai,  horizontal = FALSE, ...)

Arguments

on
logical. Indicates whether dev should be switched on or off
dev
see Details
ps
name of the pdf or postscript file
cur.cex
logical. If TRUE the par parameters of the current device are used, not the standard parameters
paper
kind of paper. Postscript parameter
width
width of figure. Postscript and pdf parameter
height
height of figure. Postscript and pdf parameter
quiet
logical. If FALSE additional information is given.
innerwidth
height of graphic without the margins; overwrites height if given -- experimental state
innerheight
width of graphic without the margins; overwrites width if given -- experimental state
mai
parameters of function par -- experimental state
horizontal
logical. If FALSE the picture is not automatically turned if height is larger than width
...
further parameters for pdf or postscript

Value

  • NULL. Side effect is that the global variable .dev.orig is created when Dev(on=TRUE,...) is called.

Details

The parameter dev might be [object Object],[object Object],[object Object],The parameters dev, ps, cur.cex, paper, width, height and ... are ignored if on=FALSE.

Examples

Run this code
## first an eps-file test.eps is created, then a jpeg-file,
  ## finally the figure is plotted on the screen
  dir(pattern="test*")
  dev.list <- list(TRUE, 1)
  if (interactive()) dev.list <- c(dev.list, "jpeg")
  for (dev in dev.list) {
    Print(dev)
    size <- if (dev=="jpeg") 450 else 5
    err <- class(try(Dev(TRUE, dev, ps="test", height=size, width=size)))
    if (err!="try-error") {
      plot(0, 0, main=paste("dev=", dev))
      # readline("press return")
      Dev(FALSE)
    }
  }
  dir(pattern="test*")

Run the code above in your browser using DataLab