ggeasy
ggeasy copied to clipboard
Feature request: `easy_gridlines_colour` function
easy_gridlines_colour(axis = c("both", "x", "y"), minor = TRUE, major = TRUE, to = NULL, teach = FALSE)
where to is the colour hex code (or colour name)
library(palmerpenguins)
library(tidyverse)
#> Warning: package 'ggplot2' was built under R version 4.3.1
#> Warning: package 'purrr' was built under R version 4.3.1
#> Warning: package 'dplyr' was built under R version 4.3.1
p <- penguins |>
ggplot() +
geom_point(aes(flipper_length_mm, body_mass_g, colour = species))
p +
theme(panel.grid.major = ggplot2::element_line(colour = "red")) +
theme(panel.grid.major.x = ggplot2::element_line(colour = "blue"))
#> Warning: Removed 2 rows containing missing values (`geom_point()`).

Created on 2023-09-20 with reprex v2.0.2
Interesting - I don't think I've ever seen someone use that, but it looks to be possible.
I've started a linked project board to track for features. Many thanks for the suggestions!
Likewise a easy_gridlines_linewidth function would be super useful too :)
This is package is a life-saver!