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

order of geom_circle does not hold #296

Closed
DSLituiev opened this issue Feb 27, 2023 · 2 comments
Closed

order of geom_circle does not hold #296

DSLituiev opened this issue Feb 27, 2023 · 2 comments

Comments

@DSLituiev
Copy link

DSLituiev commented Feb 27, 2023

there seems to be a closed issue #224, but the @Head version still does not get this right:

# none of these work:
# remotes::install_github("dmurdoch/ggforce@sortorder")
# remotes::install_github("thomasp85/ggforce")

set.seed(42)
tibble(size=1e-1 * 10^rnorm(10),
         x = rnorm(10),
         y = seq(1,10),
       fill = rbinom(10, 7, 0.2) %>% as.factor()
       ) %>% 
  arrange(-size) %>% 
  ggplot() +
  ggforce::geom_circle(aes(
    y0=y, x0=x, r=size, fill=fill,
    # order=y,
  ), colour = "black",
  ) + 
  geom_text(aes(x=x, y=y, label = y))

image

@thomasp85
Copy link
Owner

fixed

@thomasp85
Copy link
Owner

The reordering you see is because of the fill mapping which imposes a grouping which, in the end, influences the drawing order. This is a ggplot2 thing, not ggforce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants