给个例子你吧~
require(graphics)
with(cars,scatter.smooth(speed, dist))
## or with dottedthick smoothed line results :
with(cars,scatter.smooth(speed, dist, lpars =
list(col = "red",lwd = 3, lty = 3)))
还可以参考:http://flowingdata.com/2010/03/29/how-to-make-a-scatterplot-with-a-smooth-fitted-line/