| plotadd {playwith} | R Documentation |
A simple way to encapsulate a plot and annotations in one call.
plotadd(FUN, ..., add.stuff = expression())
FUN |
a high-level plot function. |
... |
arguments to FUN. |
add.stuff |
expressions to augment the plot, evaluated after plotting. |
This function is designed to be used by playwith,
so that plots can be augmented while keeping the plot arguments in one call.
the value returned by the high-level plot function.
Felix Andrews felix@nfrac.org
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()))
}