When at, label chains contain duplicate at values, axis ticks are  
dropped.  I believe this is handled incorrectly for Date ats in  
lattice 0.15-4 when compared to how it is handled for numeric, or for  
dates in base plot.  This can result in mis-labelled axes in some  
circumstances.  I have included executable examples.

R: 2.5.0

numeric base plot:

plot(1:10, axes=F); axis(1, at=c(2,4,4,6), labels=letters[1:4])

shows labels a, b, d

date scale in base plot:

plot((as.Date("2007-01-01") + 1:10), 1:10, axes=F); axis(1, at= 
(as.Date("2007-01-01")+c(2,4,4,6)), labels=letters[1:4])

shows labels a, b, d

numeric scale in lattice plot

xyplot(1:10 ~ 1:10, scales=list(x=list(relation="free", at=c 
(2,4,4,6), labels=list(letters[1:4]))))

shows labels a, b, d

date scale in lattice plot

xyplot(1:10 ~ (as.Date("2007-01-01") + 1:10) , scales=list(x=list 
(relation="free", at=list(as.Date("2007-01-01")+c(2,4,4,6)),  
labels=list(letters[1:4]))))

shows labels a, b, c

Since this results in label c being placed at position 6, not 4, I  
feel this is a bug.

-Alex Brown

______________________________________________
R-help@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
and provide commented, minimal, self-contained, reproducible code.

Reply via email to