lattice/points and pch="c" inconsistencies
This is not due to grid, it's caused by code in lattice (in lplot.xy) that was
a workaround for an old bug in grid. That bug has been fixed, but I forgot to
change the lattice code. I'll fix this by the next release (there should be a
patch release next week).
The actual grid behaviour can be seen by
xyplot(y~x,
panel = function(x, y, ...){
grid.points(x, y, pch = '.', default.units = "native")
panel.abline(h = c(0, 1))
})
Deepayan
On Thursday 12 December 2002 09:48 am, David James wrote:
Hi,
The current lattice/grid packages seem to position character
plotting symbols (e.g., ".") differently than the base function
points. The following shows what I mean:
## plain old points() positions the pch="." right at y = c(0,1),
## and thus abline(h = c(0,1)) completely hides the points "."
## (provided the output device has enough resolution, like postscript)
y <- rep(0:1, 50)
x <- 1:100
plot(x, y, pch = ".", cex = 2)
abline(h = c(0, 1))
## on the other hand, lattice/grid position the "." off the
## the y=0,1 lines, apparently centering the character's bounding box
## rather than the actual glyph;
xyplot(y~x,
panel = function(x, y, ...){
panel.xyplot(x, y, ...)
panel.abline(h = c(0, 1))
},
pch = ".", cex = 2
)
I've noticed the argument "just=" in grid.text(), but its default
value of "centre" would seem to be what's needed in this example(?)
This behavior is consistent on Linux and Windows versions of R 1.6.1,
lattice 0.6-6, and grid 0.7-2.
Is this a lattice/grid feature or a bug?