Skip to content
Back to formatted view

Raw Message

Message-ID: <4993E753.4060502@bitwrit.com.au>
Date: 2009-02-12T09:09:39Z
From: Jim Lemon
Subject: two scatter plots in one
In-Reply-To: <21963375.post@talk.nabble.com>

liujb wrote:
> Dear R users,
>
> I need to compare two scatter plots,
> plot(x1, y1)
> plot(x2, y2)
>
> and would like to plot them in the same figure. How do I do it?
>
>   
Hi liujb,
How about this:

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


Jim