How can I change the order of aestetics layers? Here\'s and example
dat <- tibble (acc = rep(c(0,1), 200), rt = rnorm(400, 0.5, 0.1)) dat
You could re-order the levels of your factor and add the color adjustment:
factor
dat %>% ggplot(aes(x = rt, fill = factor(acc, levels = c(1,0)))) + geom_density(aes(y= ..count..*0.03), alpha = 0.6)+ scale_fill_manual(values = c("1" = "#00BFC4", "0" = "#F8766D"))