+4 votes
in Programming Languages by (16.6k points)
edited by

I did not find "main" in the list of arguments of scatter.smooth() function. How can I add a title to the plot generated by this function?

1 Answer

0 votes
by (33.0k points)

If you look at the list of arguments of scatter.smooth(), it has an argument "..." which can be used to pass graphical parameters. So, you can use "main" to add the title to scatter.smooth() plot.

scatter.smooth(x, y = NULL, span = 2/3, degree = 1,
    family = c("symmetric", "gaussian"),
    xlab = NULL, ylab = NULL,
    ylim = range(y, pred$y, na.rm = TRUE),
    evaluation = 50, ..., lpars = list())

Here is an example to show how to use "main."

scatter.smooth(x, y, main="plot title here")

Related questions