grDevices (version 3.6.2)

ps.options: Auxiliary Function to Set/View Defaults for Arguments of postscript


The auxiliary function ps.options can be used to set or view (if called without arguments) the default values for some of the arguments to postscript.

ps.options needs to be called before calling postscript, and the default values it sets can be overridden by supplying arguments to postscript.


ps.options(…, reset = FALSE, override.check = FALSE)

setEPS(…) setPS(…)


arguments onefile, family, title, fonts, encoding, bg, fg, width, height, horizontal, pointsize, paper, pagecentre,, command, colormodel and fillOddEven can be supplied. onefile, horizontal and paper are ignored for setEPS and setPS.


logical: should the defaults be reset to their ‘factory-fresh’ values?


logical argument passed to check.options. See the Examples.


A named list of all the previous defaults. If or reset = TRUE is supplied the result has the visibility flag turned off.


If both reset = TRUE and ... are supplied the defaults are first reset to the ‘factory-fresh’ values and then the new values are applied.

For backwards compatibility argument append is accepted but ignored with a warning.

setEPS and setPS are wrappers to set defaults appropriate for figures for inclusion in documents (the default size is 7 inches square unless width or height is supplied) and for spooling to a PostScript printer respectively. For historical reasons the latter is the ultimate default.

See Also

postscript, pdf.options


Run this code
ps.options(bg = "pink")

### ---- error checking of arguments: ----
ps.options(width = 0:12, onefile = 0, bg = pi)
# override the check for 'width', but not 'bg':
ps.options(width = 0:12, bg = pi, override.check = c(TRUE,FALSE))
ps.options(reset = TRUE) # back to factory-fresh
# }

Run the code above in your browser using DataLab