Home Plot two graphs in same plot in R
Reply: 0

Plot two graphs in same plot in R

user413
1#
user413 Published in April 24, 2018, 8:36 am

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")
plot(x, y2, type = "l", col = "green")

But when I do it like this, they are not plotted in the same plot together.

In Matlab one can do hold on, but does anyone know how to do this in R?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.424544 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO