plmframes: Multiple Frames for Plotting

plmframesR Documentation

Multiple Frames for Plotting

Description

This is a short-cut to set some graphical parameters

Usage

plmframes(mfrow = NULL, mfcol = NULL, mft = NULL, byrow = TRUE, reduce = FALSE, 
  oma = NULL, mar = NULL, mgp = NULL, plargs = NULL, ploptions = NULL, ...)

Arguments

mfrow, mfcol

number of rows and columns of panels. The default is 1 for both, which will reset the subdivision of the plotting page.

mft

total number of panels, to be split into mfrow and mfcol by the function. The result depends on the current aspect ratio (ratio of height to width) of the plotting area.

byrow

if TRUE, the panels will be generated by rows, otherwise, by columns

reduce

logical: If the number of rows or columns asked for by mfrow or mfcol exceeds the maximum numbers determined from ploptions("mframesmax"), suitable numbers for multiple pages are calculated. If reduce is TRUE, these suggested numbers are applied.

mar

plot margins. Any NAs in mar will be replaced by appropriate values.

oma

outer plot margins. Any NAs will be replaced by appropriate values.

mgp

margin-pars passed to par(...). If NULL, it will be generated.

plargs, ploptions

result of calling pl.control, used for generating appropriate values for the margin parameters. If NULL, pl.envir will be used.

...

further graphical parameters passed to par(...).

Details

The function calls par. Its purpose is to simplify a call like par(mfrow=c(3,4)) to plmframes(3,4) and to set some defaults differently from par.

Value

A named list containing the old values of the parameters, as for par.

Author(s)

Werner A. Stahel, ETH Zurich

See Also

par

Examples

plmframes(2,3)
plmframes(mft=15)  ## will split the plotting area into >= 15 panels,
plmframes()  ## reset to 1 panel

t.plo <- ploptions(mframesmax=9, assign=FALSE)
t.mf <- plmframes(4,4, reduce=TRUE, ploptions=t.plo)
par("mfg")  
t.mf[c("mfigsug","npages")]
##  $mfigsug
##  [1] 2 4
##  $npages
##  [1] 2 1
##  if the device area was higher than wide,
##  the result is the other way 'round
t.mft <- plmframes(mft=12, reduce=TRUE, ploptions=t.plo)


plgraphics documentation built on Oct. 19, 2023, 3 p.m.