I can't test it without some example data, but
qplot(data=sites, x, y, main="Site 349")
(p <- qplot(data = sites, x, y, xlab = "", ylab = ""))
(p1 <- p + geom_smooth(method = "loess",span=0.5, size = 1.5))
p1 + theme_bw() + opts(title = "Site 349") + ylim(0, foo)
(where foo
is a suitable upper limit for your plot) might do the trick. Unlike in base graphics, the xlim() and ylim() commands in ggplot actually restrict the data that are used in making the plot, rather than just the plot window. It might also restrict the geom_smooth()
(though I'm not certain).
Edit: After reading a bit more, you might also want to consider switching out the model that geom_smooth is using. Again, not being able to see your data is a problem. But, for example, if it's binary - you can add stat_smooth(method="glm", family="binomial")
to get a logit-smoothed line. See ?stat_smooth
for more.