[R] anotating splitted plots

Victor Moreno v.moreno at ico.scs.es
Wed Sep 18 11:59:52 CEST 2002


I fit a lm model and look at the diagnostic plots. To see all 4 at once I 
split the plot area in a 2x2 matrix. If I want to add a line to the first 
plot, I can change with par(mfg=c(1,1)) , but the axes are wrong, and 
correspond to the last plot. Example:

x<-rnorm(100)
y<-2*x+rnorm(100)
m<-lm(y~x)
par(mfrow=c(2,2))
plot(m)
par(mfg=c(1,1))
abline(h=1,col=2)
abline(h=0.01,col=3)

This also happens with other plots like plot.cox.zhp of the survival library.

Any solution?

-- 
Victor Moreno	V.Moreno at ico.scs.es
Servei d'Epidemiologia i Registre del Cancer 
Institut Catala d'Oncologia
Gran Via km 2.7, 08907 Hospitalet, Barcelona, Spain
Tel: + 34 93260 7434 / 7401 / 7812    fax +34 93260 7787

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list