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

Scatterplot in which the grouping variable takes more than 4 different values does not work #28

Open
lukr90 opened this issue Mar 29, 2022 · 2 comments

Comments

@lukr90
Copy link

lukr90 commented Mar 29, 2022

Example from Documentation with grouping by cyl works. cyl takes three different values 4 6 and 8

billboarder(data = mtcars) %>% 
  bb_scatterplot(
   mapping = aes(wt, mpg, group = cyl, size = scales::rescale(qsec, to = c(0.2, 7))),
   point_opacity = 1
  ) %>% 
  bb_axis(x = list(tick = list(fit = FALSE))) %>% 
  bb_x_grid(show = TRUE) %>%
  bb_y_grid(show = TRUE)

whereas grouping by carb does not work. carb takes six different values 1 2 3 4 6 and 8

billboarder(data = mtcars) %>% 
    bb_scatterplot(
        mapping = aes(wt, mpg, group = carb, size = scales::rescale(qsec, to = c(0.2, 7))),
        point_opacity = 1
    ) %>% 
    bb_axis(x = list(tick = list(fit = FALSE))) %>% 
    bb_x_grid(show = TRUE) %>%
    bb_y_grid(show = TRUE)
@pvictor
Copy link
Member

pvictor commented Mar 31, 2022

Hello,
Thanks for reporting this. That's a bug due to groups of length one (carb == 6 or carb == 8).
That's fixed if you re-install from GitHub.

Victor

@lukr90
Copy link
Author

lukr90 commented Mar 31, 2022

Thanks!!

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