Hi Josh and David,
Problem solved. Both following steps work. 1) > ToothGrowth > attach(ToothGrowth) > plot(dose,len) # this step is needed. Don't close the diagram. Otherwise >following command won't work. > matrics=lm(len~dose) > abline(matrics) Graph displayed 2) > ToothGrowth > attach(ToothGrowth) > plot(dose, len) # this step is needed. Don't close the diagram. Otherwise >following command won't work. > abline(lm(len ~ dose, data = ToothGrowth)) Graph displayed B.R. Stephen L ----- Original Message ---- From: Joshua Wiley <[email protected]> To: Stephen Liu <[email protected]> Cc: [email protected] Sent: Sat, November 20, 2010 1:39:45 PM Subject: Re: [R] An empty grey diagram On Fri, Nov 19, 2010 at 9:35 PM, Stephen Liu <[email protected]> wrote: > Hi David, > > >> What happens when you follow the directions... i.e. type: >> plot.new() #??? > > abline(lm(len ~ dose, data = ToothGrowth)) > plot.new() > > The grey background changes to white, still an empty graph You cannot just use abline() on an empty graphic (well, you can but you get an empty graph). Please actually run my code, it will create a scatter plot, then add a line. Do not close the graphic device in between. with(ToothGrowth, plot(dose, len)) abline(lm(len ~ dose, data = ToothGrowth)) ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

