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

even.steps = FALSE does not work when binning is done outside of scale_binned #3877

Closed
pasipasi123 opened this issue Mar 9, 2020 · 2 comments · Fixed by #5783
Closed

even.steps = FALSE does not work when binning is done outside of scale_binned #3877

pasipasi123 opened this issue Mar 9, 2020 · 2 comments · Fixed by #5783

Comments

@pasipasi123
Copy link

even.steps = FALSE should produce a stretched guide_colorsteps() bar when the variable has uneven breaks. This works when binning is done inside scale_binned.

library(tidyverse)

mtcars %>% 
  mutate(mpg_cut = cut(mpg, c(seq(10, 25, 5), 35))) %>% 
  ggplot(aes(hp, mpg, color = mpg_cut)) +
  geom_point() +
  guides(color = guide_colorsteps(show.limits = TRUE, even.steps = FALSE))

Created on 2020-03-09 by the reprex package (v0.3.0)

@pasipasi123
Copy link
Author

Here's an example of uneven binning inside scale_binned.

library(tidyverse)

mtcars %>% 
  ggplot(aes(hp, mpg, color = mpg)) + 
  geom_point() + 
  scale_color_binned(breaks = c(seq(10, 25, 5), 35)) +
  guides(color = guide_colorsteps(even.steps = FALSE, show.limits = TRUE))

Created on 2020-03-09 by the reprex package (v0.3.0)

@thomasp85 thomasp85 added this to the ggplot2 3.3.1 milestone Mar 10, 2020
@thomasp85
Copy link
Member

Looking into it again, I can now remember why this behaviour is unsupported. Proper support will have to wait for a full guide rewrite I'm afraid, but I'll add a warning explaining the missing ness of this feature

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

Successfully merging a pull request may close this issue.

2 participants