ggplot2: Some geom_point shape result in strange color

Viewed 176

I am facing a rather weird problem. I want the geom_pointto have the shape |. Doing so gives me a plot with some discolouration. There seems to be some green and yellow color although I set colors to black. I thought I was wrong but saving the plot and zooming in confirmed my feeling.

I am doing this

library(ggplot2)
ggplot(iris, aes(x = Sepal.Length, y = Species)) +
  geom_point(shape= 124, size= 20, col= "black")

What I get is this (I zoomed in to clarify the problem):

plot

You may have to click on the image to see what I mean. Interestingly, this does not happen if I use shape= 1:

okay

2 Answers

I think this is simply imaging artefact rather than anything to do with ggplot as such. If you save the plot in vector format like pdf and zoom way in, the chromatic fringes aren't "really" there:

enter image description here

In addition to user Allan Camerons answer, I don't think this is an image artefact (nor chromatic aberration :). This seems to be intended and part of anti-aliasing, called subpixel rendering.

Related: See also this thread .

Possibly, it may be a sort of convention to display black with red pixels shown left, and blue pixels shown to the right (??), and therefore subpixel rendering would show those colors to each side.

Related