2

My issue is that I'd like to know how to plot smoothed lines in qplot in R, except without the gray bands around them. For instance, when I write this:

qplot(wt, mpg, data=mtcars, geom=c("smooth"), color=factor(cyl), method="lm", 
formula = y ~ ns(x,4))

The plot that appears has not only the three colored lines, but these large gray clouds around the lines. How do I remove those while also keeping the smooth lines? Geom="line" gives me very jagged lines that trace every noisy point, so those won't do either.

Any help is appreciated.

Thank you.

plannapus
  • 18,529
  • 4
  • 72
  • 94
user1165686
  • 21
  • 1
  • 4

1 Answers1

3

add se=FALSE.

from page 14 of the ggplot2 book (which is expensive, but worth it).

[bdemarest - thanks for the edit! (didn't capitalize FALSE correctly)]

andrew cooke
  • 45,717
  • 10
  • 93
  • 143