Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. # Legend looks too dark to me, both onscreen and after printing to PDF
  2. d = data.frame(x1 = 0:5, x2 = 5:10, x3 = 5:5, y1 = 0:0, y2 = 5:5, y3 = 10:10)
  3. library(ggplot2)
  4. ggplot(d) + theme_bw() +
  5. geom_ribbon(aes(x = x1, ymin = y1, ymax = y2, fill = 'red'),
  6. alpha = 0.5) +
  7. geom_ribbon(aes(x = x2, ymin = y2, ymax = y3, fill = 'red'),
  8. alpha = 0.5) +
  9. geom_ribbon(aes(x = x1, ymin = y2, ymax = y3, fill = 'blue'),
  10. alpha = 0.5) +
  11. geom_ribbon(aes(x = x2, ymin = y1, ymax = y2, fill = 'blue'),
  12. alpha = 0.5) +
  13. scale_fill_manual(name = NULL, values = c('red', 'blue')) +
  14. guides(fill = guide_legend(override.aes = list(alpha = 0.5)))
  15. ggsave("p1.pdf", width = 6.5, height = 5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement