Skip to content

two scatter plots in one

4 messages · liujb, jim holtman, Jim Lemon +1 more

#
Set the xlim/ylim to the extent of the data and then do

plot(x1, y1, xlim=range(x1, x2), ylim=range(y1, y2))
points(x2, y2, col='red')
On Wed, Feb 11, 2009 at 3:43 PM, liujb <liujulia7 at yahoo.com> wrote:

  
    
#
liujb wrote:
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
#
lattice and ggplot2 also offer a general way of doing this,

        
On 12 Feb 2009, at 09:09, Jim Lemon wrote:

            
_____________________________

Baptiste Augui?

School of Physics
University of Exeter
Stocker Road,
Exeter, Devon,
EX4 4QL, UK

Phone: +44 1392 264187

http://newton.ex.ac.uk/research/emag