Consider the `after_scale()` example from `?aes_eval`: ``` r 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: ``` r ggplot(mpg, aes(class, hwy, colour = class, fill = after_scale(alpha(colour, 0.4)))) + geom_boxplot() ``` 
Activity
yutannihilation commentedon Nov 15, 2020
Thanks, this seems because
Layer$compute_geom_2()refers only to the layer's mapping and ignoresplot$mapping.ggplot2/R/layer.r
Lines 356 to 364 in a132727
I think
compute_geom_2()needs to takeplotas we do withmap_statistics().ggplot2/R/plot-build.r
Line 73 in a132727