Skip to content
Prev 157009 / 398506 Next

Changing a plot

One way is to keep a copy of the original and then return to it when you 
need it.

  x <- rnorm(100,1,0.5)
  y <- rnorm(100,1,0.5)
  plot(x,y,pch=16)
  original <- recordPlot()

  for( i in 1:10 ){
    points( x[i], y[i], pch=19, col="yellow", cex=3)
    points( x[i], y[i], pch=16)
    Sys.sleep(1)                  # slow the graphs a bit
    replayPlot(original)
  }

Regards, Adai
R Help wrote: