I would like to plot y1 and y2 in the same plot.
x <- seq(-2, 2, 0.05) y1 <- pnorm(x) y2 <- pnorm(x, 1, 1) plot(x, y1, type = \"l\", col = \"red\")
lines() or points() will add to the existing graph, but will not create a new window. So you'd need to do
lines()
points()
plot(x,y1,type="l",col="red") lines(x,y2,col="green")