Skip to content

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

Closed

Description

@pasipasi123

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)

Activity

  1. pasipasi123 commented on Mar 9, 2020

    @pasipasi123
    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)

  2. added this to the milestone on Mar 10, 2020
  3. thomasp85 commented on Mar 10, 2020

    @thomasp85
    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

  4. removed this from the milestone on Mar 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions