Skip to content

geom_bar does not play well with scale_fill_binned #4184

@jtlandis

Description

@jtlandis

As the title says, it seems that geom_bar does not interact with scale_fill_binned. I'm assuming this is because the fill aesthetic is ignored if a continuous variable is passed.

I'm not sure if there are any other geoms that would have a similar issue.

#Fill is ignored
ggplot(mpg) + 
   geom_bar(aes(displ, fill = cty)) + 
   scale_x_binned() +
   scale_fill_binned()

#likely result expected
 ggplot(mpg) + 
    geom_bar(aes(displ, fill = cut(cty, seq(8,38,6)))) + 
    scale_x_binned() 

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorscales 🐍

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions