library("forecast")
data(gold)
g <- data.frame(g = na.omit(coredata(gold)))$g
y_width <- c(min(g) - min(g) * 0.05, max(g) - max(g) * 0.05) 

plot(g, type="l", lty="dotted", ylim=y_width)
par(new=T)
plot(smooth(g, twiceit=T), type="l", col="blue", ylim=y_width, ylab="")