With the function curve you may plot a function. The following example shows how to use this function.
curve(x^3, from = -10 , to = 10, main = ‚f(x)=x^3‘, lwd = 2)
The curve function offers the option add = TRUE. This will allow you to add a curve to an existing plot. The following example will add two more functions to the existing one.
curve(x^3, from = -10 , to = 10, main = ‚Several functions in one plot‘, lwd = 2)
curve(2*x^3+300, lwd = 2, add = TRUE)
curve(x^3+10*x^2-500, lwd = 2, add = TRUE)