[R] plot help

Greg Snow Greg.Snow at imail.org
Thu Jan 24 17:30:48 CET 2008


Look at the examples for cnvrt.coords in the TeachingDemos package, they
might give you some ideas to accomplish what you want.

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
(801) 408-8111
 
 

> -----Original Message-----
> From: r-help-bounces at r-project.org 
> [mailto:r-help-bounces at r-project.org] On Behalf Of tom soyer
> Sent: Wednesday, January 23, 2008 8:14 PM
> To: r-help at r-project.org
> Subject: [R] plot help
> 
> Hi,
> 
> Suppose I already have two plots on the same screen, and I 
> want to draw lines in each of them. Is that possible in R? It 
> seems that once you have two plots on the screen, you can 
> only draw lines in the the last plot, never the 1st. Here is 
> what I mean:
> 
> #some data
> y1=rnorm(1:3)
> y2=rnorm(1:3)
> 
> #draw two plots on the same screen
> par(mfrow=c(2,1),oma = c(6, 0, 5, 0))
> par(mar=c(0, 5.1, 0, 5.1))
> plot(y1,xaxt="n",type="n") #1st plot
> par(mar=c(0, 5.1, 0, 5.1))
> plot(y2,xaxt="n",type="n") #2nd plot
> 
> #try to draw lines onto each plot on the screen
> lines(y2) #draws a line in the 2nd plot
> lines(y1,col=2) #also draws a line in the 2nd plot, but 
> that's not what I want. I want to draw the line in the 1st 
> plot instead.
> 
> Does anyone know if after more than one plot were drawn, can 
> I still call the 1st plot and draw a line in it?
> 
> Thanks,
> 
> --
> Tom
> 
> 	[[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.
> 



More information about the R-help mailing list