[R] Lattice graphics adding abline line (1:1 line) ???

iwaite iwaite at usgs.gov
Tue Aug 28 00:49:14 CEST 2012


I have read multiple books and looked at many posts online and can't seem to
figure out how to add a 1:1 line in lattice xyplot. I've tried multiple
versions of getting this to work, including trying "panel.abline(h=0,v=1),
panel=function and others. 

Second question, how do I get the legend created via "auto.key" to use the
"pch=c(15,16,17,18) and associated colors, these are circle, square,triangle
and diamond, but the auto.key just plots points with different default
colors, not the grey scales and symbols that the actual plots uses, how do I
get these to match. Is auto.key not the way to go, again I read on many
different methods, but no luck yet.

Thanks,
    Ian

xyplot(Inv591$RichTOL~gbm_tol$fitted, data=Inv591,group=EcoRegion, main=
"Observed vs Predicted for RichTOL (BRT development model)",xlab="Observed
RichTOL", ylab="Predicted RichTOL", xlim= c(2,8), ylim= c(2,8),
pch=c(15,16,17,18), cex=1.1,
col=c('grey10','grey30','grey60','grey80'),cex.lab=1.8, cex.axis=1.8,font=2,
auto.key=list(corner=c(1,0)),
panel=function(x,y){
panel.xyplot(x,y)
panel.abline(lm(Inv591$RichTOL~gbm_tol$fitted)) 



--
View this message in context: http://r.789695.n4.nabble.com/Lattice-graphics-with-combined-plot-types-tp790070p4641486.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list