ggdist
ggdist copied to clipboard
Create custom scales / aesthetics for lineribbons
including:
- [ ] make alpha only apply to ribbons by default (? - might need to remove duplicate lines)
- [ ] make aesthetics to target alpha on ribbon versus line separately
- [ ] outline color on ribbons
Just ran into this problem. I'd like to set ribbon fill, but not the line, semitransparent. Is there a current workaround for this?
The simplest workaround would probably be to disable the line (color = NA) and then draw the line as a separate geom. That, or you could try assigning a fill color that has an alpha component to it (not 100% sure that would work)
Got it. After playing around, this works:
data %>%
ggplot(aes(x = x, y = Estimate, ymin = Q2.5, ymax = Q97.5,
fill = condition, color = condition)) +
geom_lineribbon() +
scale_fill_viridis_d(alpha = 1/2) +
scale_color_viridis_d()
Awesome! Had no idea the color scales had an alpha argument, that's very useful!