[R] Overplotting two series of observations in R

Uwe Ligges ligges at statistik.uni-dortmund.de
Wed Jan 8 16:02:03 CET 2003


Marcus Mattos Riether wrote:
> 
> Hi all.
> 
> Could anyone help me find how to overplot two series of observations in the
> same window?
> 
> Thanks.
> 
> Marcus M. Riether


This question was already frequently asked (and answered!) on R-Help.
Please check the mail archives for a couple of more detailed answers!
The required tools are described in the graphics part of "An
Introduction to R".

In an outburst of kindness, let's demonstrate the principle again.
Consider you want to plot y1 against x1 and y2 against x2 in the same
plot:

 plot(x1, y1, xlim = range(x1, x2), ylim = range(y1, y2))
 points(x2, y2, col = "red")

Uwe Ligges




More information about the R-help mailing list