Bug 15831 - pch="." misaligned
Summary: pch="." misaligned
Status: NEW
Alias: None
Product: R
Classification: Unclassified
Component: Graphics (show other bugs)
Version: R 3.1.0
Hardware: x86_64/x64/amd64 (64-bit) Windows 64-bit
: P5 minor
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2014-06-21 18:25 UTC by Jon
Modified: 2016-10-07 09:00 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jon 2014-06-21 18:25:57 UTC
Platform
--------

Using "RGui (64-bit)" on Windows 8.1:

> 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)) ?