Skip to content

Interactive plot using playwith() and abline

2 messages · Christoph Scherber, Felix Andrews

#
Dear all,

Is it possible to use abline() after calling playwith(plot(...)))?

x=1:10
y=x^2

playwith(plot(x,y)) # works fine
playwith({abline(lm(y~x))}) # doesn?t work


Thanks!

Christoph
#
Indeed, the call you pass to playwith() must be a self-contained plot
function. Try one of these:

playwith( {plot(x,y); abline(lm(y~x)} )

playwith(plot(x,y, panel.last=abline(lm(y~x))))

playwith(xyplot(y ~ x, type=c("p", "r")))


On Sat, Jul 26, 2008 at 1:52 AM, Christoph Scherber
<Christoph.Scherber at agr.uni-goettingen.de> wrote: