Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. library(tidyverse)
  2. df <- data.frame(x = c(1,2),
  3. y = c(1,2))
  4. df %>% ggplot(aes(x, y)) +
  5. geom_area() + theme(
  6. panel.grid = element_line(color = "red")
  7. )
  8.  
  9. grd_x <- seq(1, 2, length.out = 9)
  10. grd_y <- seq(0, 2, length.out = 9)
  11.  
  12. df %>% ggplot(aes(x, y)) +
  13. geom_area() +
  14. geom_hline(yintercept = grd_y, col = "red") +
  15. geom_vline(xintercept = grd_x, col = "red")
  16.  
  17. library(tidyverse)
  18. df <- data.frame(x = c(1,2),
  19. y = c(1,2))
  20. df %>% ggplot(aes(x, y)) +
  21. geom_area() +
  22. theme(panel.grid = element_line(color = "red"),
  23. panel.ontop = TRUE, panel.background = element_rect(color = NA, fill = NA)
  24. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement