ggforce icon indicating copy to clipboard operation
ggforce copied to clipboard

fill mapping not working correctly in geom_mark_ellipse

Open py9mrg opened this issue 3 years ago • 0 comments

Hello,

geom_mark_ellipse does not seem to be filling the ellipses correctly - it misses out some colour mappings - e.g. for one of the examples in the documentation:

library(ggforce)
#> Loading required package: ggplot2
ggplot(iris, aes(Petal.Length, Petal.Width)) +
  geom_mark_ellipse(aes(fill = Species, filter = Species != 'versicolor')) +
  geom_point()

Created on 2021-06-24 by the reprex package (v2.0.0)

EDIT:

weirdly, this seems specific to the iris dataset:

library(ggforce)
#> Loading required package: ggplot2
test_tbl <- data.frame(x = 1:6, y = 1:6, group = rep(LETTERS[1:3], 2))
ggplot(test_tbl, aes(x, y)) +
  geom_mark_ellipse(aes(fill = group)) +
  geom_point()

Created on 2021-06-24 by the reprex package (v2.0.0)

EDIT 2:

This sometimes happens and sometimes doesn't with a variety of data sets I've tried today - I haven't yet worked out what is different about them that means some do and some don't. But I have noticed that, as far as I can tell, saving with ggsave is always correct - i.e. the ellipses are all correctly filled - whereas the reprex above and RStudio will sometimes show no fill.

py9mrg avatar Jun 24 '21 09:06 py9mrg