[R] plot the same types of graphics on the same R graphic device

John Kane jrkrideau at yahoo.ca
Sat Oct 10 00:01:01 CEST 2009


?lines
?points

Something like :

x <- 1:10
y1 <- rnorm(10, 4, 3)
y2 <- rnorm(5,5,2)

ymax <- max(c(y1,y2))
ymin <- min(c(y1,y2))


plot(x, y1, col='red',ylim = c(ymin,ymax))
lines(y2, col='green')



--- On Fri, 10/9/09, carol white <wht_crl at yahoo.com> wrote:

> From: carol white <wht_crl at yahoo.com>
> Subject: [R] plot the same types of graphics on the same R graphic device
> To: r-help at stat.math.ethz.ch
> Received: Friday, October 9, 2009, 5:10 PM
> Hi,
> How to plot the same types of graphics on the same R
> graphic device? Suppose that we want to plot a vector y
> against x (using plot for instance). How is it possible to
> plot y against x for different values of these two vectors
> on the same device so that the plots could be compared?
> 
> Cheers,
> 
> Carol
> 
> 
> 
>       
>     [[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org
> mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained,
> reproducible code.
> 


      __________________________________________________________________
Looking for the perfect gift? Give the gift of Flickr! 

http://www.flickr.com/gift/




More information about the R-help mailing list