MichaelChirico / r-bugs

A ⚠️read-only⚠️mirror of https://bugs.r-project.org/
20 stars 0 forks source link

[BUGZILLA #15831] pch="." misaligned #5368

Open MichaelChirico opened 4 years ago

MichaelChirico commented 4 years ago

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:

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

MichaelChirico commented 4 years ago

I ran the test case on my mac and got the attached. It looks okay to me. Do you still get the problem?


METADATA

MichaelChirico commented 4 years ago

Created attachment 2541 [details] Results from running code in 02-2020


METADATA

INCLUDED PATCH