Skip to contents

Easily execute a code block in a specified graphics context.

Usage

with_grdev(
  grdev_name,
  code,
  width = getOption("mty.fig.width", 7),
  height = getOption("mty.fig.height", 7),
  res = getOption("mty.fig.res", 96),
  units = getOption("mty.fig.units", "in"),
  ...,
  par_opts = list(),
  .envir = parent.frame()
)

Arguments

grdev_name

the name of the graphics device, e.g. "svg" or "png"

code

client code block

width

width

height

height

res

resolution

units

units of width and height

...

passed to dev_args

par_opts

graphical parameters, rather than passed through ... in plot

.envir

the environment in which to evaluate the code