Hello all, I'm a new user on R, and I used the abline function to draw a line on my graph but it doesn't work with xyplot(). With the plot function, abline() is ok but with plot it doesn't make what I want. Maybe it's a little thing to change in plot() but I don't find what! With xyplot I write this : Xyplot(m~ordered(l,levels=1), type="b",xlab="lagdist",ylab="Moran'I",lty=1,lwd=2,cex=1.5,pch=pch) Abline(h=0,lty=2) There's no error message but no line too. If someone see my error or know how to do, thanks in advance. ChloƩ Archinard CEFE-CNRS 1919 Route de Mende 34293 Montpellier, Cedex 5, France -- passerelle antivirus du campus CNRS de Montpellier -- [[alternative HTML version deleted]]
probably you want to look at this: help(panel.abline, package="lattice") I hope it helps. Best, Dimitris ---- Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/16/336899 Fax: +32/16/337015 Web: http://www.med.kuleuven.ac.be/biostat/ http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm ----- Original Message ----- From: "Chloe ARCHINARD" <Chloe.ARCHINARD at cefe.cnrs.fr> To: <r-help at stat.math.ethz.ch> Sent: Tuesday, April 12, 2005 2:38 PM Subject: [R] abline() with xyplot() Hello all, I'm a new user on R, and I used the abline function to draw a line on my graph but it doesn't work with xyplot(). With the plot function, abline() is ok but with plot it doesn't make what I want. Maybe it's a little thing to change in plot() but I don't find what! With xyplot I write this : Xyplot(m~ordered(l,levels=1), type="b",xlab="lagdist",ylab="Moran'I",lty=1,lwd=2,cex=1.5,pch=pch) Abline(h=0,lty=2) There's no error message but no line too. If someone see my error or know how to do, thanks in advance. Chlo? Archinard CEFE-CNRS 1919 Route de Mende 34293 Montpellier, Cedex 5, France -- passerelle antivirus du campus CNRS de Montpellier -- [[alternative HTML version deleted]] ______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
On Tuesday 12 April 2005 07:38, Chloe ARCHINARD wrote:> Hello all, > I'm a new user on R, and I used the abline function to draw a line on > my graph but it doesn't work with xyplot(). With the plot function, > abline() is ok but with plot it doesn't make what I want. Maybe it's > a little thing to change in plot() but I don't find what! With xyplot > I write this : > Xyplot(m~ordered(l,levels=1), > type="b",xlab="lagdist",ylab="Moran'I",lty=1,lwd=2,cex=1.5,pch=pch) > Abline(h=0,lty=2)I'm not aware of anything called 'Xyplot' or 'Abline' (note that R is case sensitive).> There's no error message but no line too. > If someone see my error or know how to do, thanks in advance.'xyplot' is part of a graphics system that is different from standard R graphics. If you want to use it, you first need to learn how. help(Lattice) has some pointers that should get you started. In this case, you probably want something like xyplot(m ~ ordered(l, levels=1), type="b", xlab="lagdist", ylab="Moran'I", lty=1, lwd=2, cex=1.5, pch=pch, panel = function(...) { panel.abline(h = 0, lty = 2) panel.xyplot(...) }) -Deepayan