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

Answer by Sam for Plot two graphs in a same plot

$
0
0

You can also use par and plot on the same graph but different axis. Something as follows:

plot( x, y1, type="l", col="red" )par(new=TRUE)plot( x, y2, type="l", col="green" )

If you read in detail about par in R, you will be able to generate really interesting graphs. Another book to look at is Paul Murrel's R Graphics.


Viewing all articles
Browse latest Browse all 18

Trending Articles



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