I would like to plot and unplot a line to a graph using R's line command. This would allow for sequentially trying different plotted functions for a visual fit. Is there a way to do this? Rex
On 11 Jan 2003 at 14:11, RexBryan wrote: plot(1:10, 1:10, type="n") lines(1:10, 1:10) lines(1:10, 1:10, color="white") Kjetil Halvorsen> I would like to plot and unplot a line to a graph using R's line > command. This would allow for sequentially trying different plotted > functions for a visual fit. Is there a way to do this? > > Rex > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > http://www.stat.math.ethz.ch/mailman/listinfo/r-help
"RexBryan" <rexbryan1 at attbi.com> writes:> I would like to plot and unplot a line to a graph using R's line > command. This would allow for sequentially trying different plotted > functions for a visual fit. Is there a way to do this?you can try re-plotting the line you want to erase in the color that matches the bacground, e.g. x <- rnorm(100) plot(x) lines(1:100, cos(1:100)) # assess quality of fit, then erase: lines(1:100, cos(1:100), col="white") # draw next fit lines(1:100, sin(1:100)) the solution isn't "clean" in that erasing the line may also erase some of the points. to prevent this, use points(x), or re-plot altogether via plot(x) hope this helps, alejandro
Seemingly Similar Threads
- Problem with differences between S+ and R in parsing output tables with $
- Is R really an open source S+ ?
- comparing class() -- R=NULL and S+=numeric
- Ideas needed on automation of R
- FW: Answers to "Problem with differences between S+ and R in parsing output tables with $"