plotadd {playwith}R Documentation

Augment a plot in-line

Description

A simple way to encapsulate a plot and annotations in one call.

Usage

plotadd(FUN, ..., add.stuff = expression())

Arguments

FUN a high-level plot function.
... arguments to FUN.
add.stuff expressions to augment the plot, evaluated after plotting.

Details

This function is designed to be used by playwith, so that plots can be augmented while keeping the plot arguments in one call.

Value

the value returned by the high-level plot function.

Author(s)

Felix Andrews felix@nfrac.org

Examples

if (interactive()) {

x <- rnorm(64)
plot(x, x^2, cex=2)
rug(x)
grid()

# do it all in one call with plotadd
plotadd(plot, x, x^2, cex=2, 
        add.stuff=expression(rug(x), grid()))

}

[Package playwith version 0.8.51 Index]