Quantcast
Channel: Plot two graphs in a same plot - Stack Overflow
Viewing all articles
Browse latest Browse all 18

Plot two graphs in a same plot

$
0
0

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?


Viewing all articles
Browse latest Browse all 18

Trending Articles





<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>