Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geom_bin has white dots on the borders #2157

Closed
idavydov opened this issue Jun 14, 2017 · 4 comments
Closed

geom_bin has white dots on the borders #2157

idavydov opened this issue Jun 14, 2017 · 4 comments
Labels
reprex

Comments

@idavydov
Copy link

idavydov commented Jun 14, 2017

When creating geom_bin plot, white dots are introduced between the bins. Is it possible to get rid of those?

The same is reproduced in the current master (f84e315) & current cran (2.2.1) versions on the latest R (3.4.0).

library(ggplot2)
N=1000
d <- data.frame(x=rnorm(N), y=rnorm(N))
## png('hex.png')
ggplot(d, aes(x, y)) + geom_hex()
## dev.off()

hex

@idavydov
Copy link
Author

idavydov commented Jun 14, 2017

While this looks like a bug to me, it seems there's a workaround. You can add border of the same color:

library(ggplot2)
N=1000
d <- data.frame(x=rnorm(N), y=rnorm(N))
## png('hex.png')
ggplot(d, aes(x, y)) + geom_hex(col=..count..)
## dev.off()

hex

@karawoo
Copy link
Member

karawoo commented Jun 14, 2017

I can't reproduce the white dots. When I run the first example I get a consistent light border around all the hexagons:

hex

@karawoo karawoo added the reprex label Jun 14, 2017
@idavydov
Copy link
Author

idavydov commented Jun 14, 2017

@karawoo I think it is OS and device specific.
It is reproduced on GNU/Linux with X11 or png device (two different machines, one with R 3.4.0, another with 3.2.3). But it cannot be reproduced if the pdf() device is used.

  1. Could you try to reproduce this with GNU/Linux+X11?
  2. If it is device specific, can this be an expected behavior for some devices?

@hadley
Copy link
Member

hadley commented Jul 13, 2017

Yeah, this is an issue with your graphics device so there's nothing ggplot2 can do about it.

@hadley hadley closed this as completed Jul 13, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
reprex
Projects
None yet
Development

No branches or pull requests

3 participants