plmarginpar: Set Graphical Parameters According to Those used in the Pl...

plmarginparR Documentation

Set Graphical Parameters According to Those used in the Pl Function Called Last

Description

plmarginpar calls par to set the margin widths mar and mgp equal to those used in the last call of a high level pl function

Usage

plmarginpar(plargs = pl.envir, csize = NULL)

Arguments

plargs

list from which the margin parameters are obtained. If NULL, the default, pl.envir is used.

csize

size of plot symbols and text, changes par("cex") to csize*par("cex")

Value

The old settings of par(c("mar","mgp")) are returned invisibly.

Note

plmarginpar is used to complement a plot with low level ordinary R functions like mtext or segments, see Example.

The same effect can be achieved by setting the pl option keeppar to TRUE, either by calling ploptions or by setting keeppar=TRUE in the call to the high level pl function.

Author(s)

Werner A. Stahel

Examples

par(mar=c(2,2,5,2))
plyx(Sepal.Width~Sepal.Length, data=iris) ## margins according to ploptions
par("mar") ## paramteres have been recovered
mtext("wrong place for text",3,1, col="red")  ## margins not appropriate for active plot
plmarginpar()
par("mar") ## margins used inside the call to  plyx . These are now active
mtext("here is the right place",3,1, col="blue")

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