plotprep: plotprep: sets up a window and the par values for a single...

View source: R/datalow_utils.r

plotprepR Documentation

plotprep: sets up a window and the par values for a single plot

Description

plotprep: sets up a window and the par values for a single plot. it checks to see if a graphics device is open and opens a new one if not. This is simply a utility function to save typing the standard syntax. Some of the defaults can be changed. Typing the name without () will provide a template for modification. If 'windows' is called repeatedly this will generate a new active graphics device each time leaving the older ones inactive but present. For quick exploratory plots this behaviour is not wanted, hence the check if an active device exists already or not.

Usage

plotprep(
  width = 6,
  height = 3.6,
  plots = c(1, 1),
  usefont = 7,
  cex = 0.85,
  xmtext = TRUE,
  ymtext = TRUE,
  newdev = TRUE,
  rows = TRUE,
  filename = ""
)

Arguments

width

defaults to 6 inches = 15.24cm - width of plot

height

defaults to 3 inches = 7.62cm - height of plot

plots

defaults to c(1,1), but arranges multiple plots. If used it may be necessary to print out this code and adjust the mai and oma variables

usefont

default is 7 (bold Times); 1 = sans serif, 2 = sans serif bold

cex

default is 0.85, the size of font used for text within the plots

xmtext

default is TRUE; if plots is not c(1,1) this alters the mai and oma variables for the x-axis to allow for mtexting and avoid the x title

ymtext

default is TRUE; if plots is not c(1,1) this alters the mai and oma variables for the y-axis to allow for mtexting and avoid the y title

newdev

reuse a previously defined graphics device or make a new one; defaults to TRUE

rows

defaults to TRUE, determines whether to use mfrow or mfcol

filename

defaults to "" = do not save to a filename. If a filename is

Value

Checks for and sets up a graphics device and sets the default plotting par values. This changes the current plotting options!

Examples

x <- rnorm(1000,mean=0,sd=1.0)
plotprep()
hist(x,breaks=30,main="",col=2)

haddonm/datalowSA documentation built on Nov. 5, 2023, 6:40 p.m.