R version 3.1.0 (2014-04-10) -- "Spring Dance"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
Detail
------
Plotting symbol pch="." appears to be misaligned on the screen.
That's "misaligned" in the sense of frequently being one pixel off (I've observed above, to the left, and both) the position of:
abline(h=...) and abline(v=...)
pch=3
lines( c(x,x), c(y,y) )
all of which, from limiting testing, seem to be consistent.
Whether or not the symbol is "off" depends on the on-screen size of the plotting area; resizing can pull the point off or back on to the "correct" position. I've only tested cex=1 which, on my screen, results in a single pixel.
Plotting symbol pch="+" is similarly misaligned. I'm flagging-up "." in particular because the documentation describes it as a special case, which to this lazy reader implied that it would be correctly aligned.
Test case
---------
x=1/pi;y=2/pi
plot(c(0,1),c(0,1),type="n")
abline(h=y,col="cyan")
abline(v=x,col="cyan")
points(x,y,pch=3,col="orange") # consistent with ablines
points(x,y,pch=46,col="black") # often misaligned
Workaround
----------
If I want to plot a minimal-sized symbol, with pixel-perfect alignment to horizontal and vertical lines, then is there a better way than lines(c(x,x),c(y,y)) ?
Platform --------
Using "RGui (64-bit)" on Windows 8.1:
Detail ------
Plotting symbol pch="." appears to be misaligned on the screen.
That's "misaligned" in the sense of frequently being one pixel off (I've observed above, to the left, and both) the position of:
all of which, from limiting testing, seem to be consistent.
Whether or not the symbol is "off" depends on the on-screen size of the plotting area; resizing can pull the point off or back on to the "correct" position. I've only tested cex=1 which, on my screen, results in a single pixel.
Plotting symbol pch="+" is similarly misaligned. I'm flagging-up "." in particular because the documentation describes it as a special case, which to this lazy reader implied that it would be correctly aligned.
Test case ---------
x=1/pi;y=2/pi plot(c(0,1),c(0,1),type="n") abline(h=y,col="cyan") abline(v=x,col="cyan") points(x,y,pch=3,col="orange") # consistent with ablines points(x,y,pch=46,col="black") # often misaligned
Workaround ----------
If I want to plot a minimal-sized symbol, with pixel-perfect alignment to horizontal and vertical lines, then is there a better way than lines(c(x,x),c(y,y)) ?
METADATA