Hi,
I recently encountered situations in which reference lines are not drawn with
the lattice panel.abline function. Please, consider the following example code:
require(lattice)
a <- runif(1,0,100)
data <- data.frame(x=c(0,a^2), y=c(0,a^2))
xyplot(
y~x,
data = data,
type = 'l',
panel = function(x,y,...){
panel.xyplot(x,y,...)
panel.abline(c(a^2,-1.0), col=2)
}
)
Adding noise (eg panel.abline(c(a^2+0.01,-1.0), col=2)) or adding some axis
limits seems to bypass the problem.
The problem also happens for different data source and abline coefficients:
data <- data.frame(x=c(18,81), y=c(18,81))
...
panel.abline(c(99,-1.0), col=2)
Thank you in advance for your feedback.
Sebastien
PS: the problem was also posted at https://github.com/deepayan/lattice/issues/8
______________________________________________
[email protected] mailing list -- To UNSUBSCRIBE and more, see
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.