Hello

On 8/27/09, Josh Roll <j_r...@hotmail.com> wrote:
>     I am having trouble getting both graphs on the same page.  Its
> separating them, especially when i write them to a pdf.  I need visual
> comparison capabilities.  Do i need to include the two data sets in the same
> "plot" to make this happen.  Thanks
>
http://www.statmethods.net/advgraphs/layout.html
http://wiki.r-project.org/rwiki/doku.php?id=tips:graphics-base:overlapping_plots

Perhaps this:
Sz= c("h1","h2","h3","h4")
 Pred=c(34790.0 ,47559.8, 21197.8, 28198.6)
 Obs=c(34740 ,48615 ,20420, 26840)
 plot(Pred, t="l", ylim=c(20000,50000))
 text(Pred, Sz, cex=0.6, pos=4, col="red")
 par(new=TRUE)
 plot(Obs, t="l", ylim=c(20000,50000))
 text(Obs, Sz, cex=0.6, pos=4, col="blue")

Alternatively you can use lines(), but always pay attention that both
graphs be constructed with teh same x and y limits.
Liviu

______________________________________________
R-help@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.

Reply via email to