Gradient in geom_ribbon

1 answer

geom_ribbon does not support gradient. Instead, if I understand correctly what you want to do, overlapping tapes can be useful:

 d <- data.frame(x=1:10, m=runif(10)) d <- transform(d, l1=m-1, l2=m-2, u1=m+1, u2=m+2) ggplot(d, aes(x)) + geom_ribbon(aes(ymin=l2, ymax=u2), fill="grey60") + geom_ribbon(aes(ymin=l1, ymax=u1), fill="grey40") 
+7
source

Source: https://habr.com/ru/post/1338624/


All Articles