How to plot x1, x2, x3 and more in the same plot?

Viewed 171

How to plot x1, x2, x3 and more in the same plot ? I am working in a small project, where I want to show all plots in the same plot.

a  <- seq(-4, 4, 0.05)
x1 <- pnorm(a)
x2 <- pnorm(a, 2, 2)
x3 <- pnorm(a, 5, 5)

plot(a, x1, type = "p", col = "black")
plot(a, x2, type = "p", col = "blue")
plot(a, x3, type = "p", col = "red")

I would really appreciate if you just give me a hint

1 Answers

Try this

plot(a,x1, type = "p", col="black")
points(a,x2,col="blue")
points(a,x3,col="red")

If you have question, let me know

Related