[R] Howto overlay two plots and save them in one pdf file?

Thomas Schönhoff tom_hoary at web.de
Thu Apr 21 12:59:40 CEST 2005


Hello,

I do have two different plots from LAD and OLS regression objects like 
this:

# LAD regression and related plot
rq(formula = SBP ~ Age)
f = coef(rq(SBP ~ Age))
pred = f[1] + f[2]*Age
plot (Age, SBP)
lines (Age, pred)

# OLS regression and related plot
Pred = lm(SBP ~ Age)
plot (Age, SBP)
lines (Age,fitted(Pred))



Well for comparatative reason I would would like to subsume both plots 
into a unifying plot and save them in one file.pdf.
I tried to find an answer in FAQ and mailinglists archive, no luck. 
Maybe did miss an appropiate answer to my question, so a pointer to 
solve my problem woud be sufficient!

Much thanks

Thomas


My system:


platform i686-pc-linux-gnu
arch     i686             
os       linux-gnu        
system   i686, linux-gnu  
status                    
major    2                
minor    0.1              
year     2004             
month    11               
day      15               
language R




More information about the R-help mailing list