Skip to content

after_scale() in the initial ggplot() callΒ #4260

@mikmart

Description

@mikmart

Consider the after_scale() example from ?aes_eval:

library(ggplot2) # tidyverse/ggplot2@a132727

ggplot(mpg, aes(class, hwy)) +
  geom_boxplot(aes(colour = class, fill = after_scale(alpha(colour, 0.4))))

Moving the colour and fill specification form the geom to the initial ggplot() call causes the fill to not be mapped at all:

ggplot(mpg, aes(class, hwy, colour = class, fill = after_scale(alpha(colour, 0.4)))) +
  geom_boxplot()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorlayers πŸ“ˆ

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions