Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Legend looks too dark to me, both onscreen and after printing to PDF
- d = data.frame(x1 = 0:5, x2 = 5:10, x3 = 5:5, y1 = 0:0, y2 = 5:5, y3 = 10:10)
- library(ggplot2)
- ggplot(d) + theme_bw() +
- geom_ribbon(aes(x = x1, ymin = y1, ymax = y2, fill = 'red'),
- alpha = 0.5) +
- geom_ribbon(aes(x = x2, ymin = y2, ymax = y3, fill = 'red'),
- alpha = 0.5) +
- geom_ribbon(aes(x = x1, ymin = y2, ymax = y3, fill = 'blue'),
- alpha = 0.5) +
- geom_ribbon(aes(x = x2, ymin = y1, ymax = y2, fill = 'blue'),
- alpha = 0.5) +
- scale_fill_manual(name = NULL, values = c('red', 'blue')) +
- guides(fill = guide_legend(override.aes = list(alpha = 0.5)))
- ggsave("p1.pdf", width = 6.5, height = 5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement