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.