Skip to content

Cannot override.aes with guide_bins? #4085

Closed
@jdsher

Description

@jdsher

Controlling the appearance of the geoms within a scale_size_binned legend using guide_bins() doesn't seem to operate in the same fashion as guide_legend() - or rather, there appears to be no overriding the aes() despite the documentation implying no difference.

To illustrate, this:

ggplot(mtcars, aes(x = drat, y = wt, size = hp, fill = cyl)) + 
geom_point(shape = 21) + 
scale_size_binned(guide = guide_legend(override.aes = list(colour = "red", shape = 21, fill = "blue")))

...works as expected, while this:

ggplot(mtcars, aes(x = drat, y = wt, size = hp, fill = cyl)) + 
geom_point(shape = 21) + 
scale_size_binned(guide = guide_bins(override.aes = list(colour = "red", shape = 21, fill = "blue")))

...does not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorguides 📏

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions