ggeasy icon indicating copy to clipboard operation
ggeasy copied to clipboard

Feature request: `easy_gridlines_colour` function

Open davidhodge931 opened this issue 2 years ago • 2 comments

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

davidhodge931 avatar Sep 19 '23 22:09 davidhodge931

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!

jonocarroll avatar Sep 19 '23 23:09 jonocarroll

Likewise a easy_gridlines_linewidth function would be super useful too :)

This is package is a life-saver!

davidhodge931 avatar Sep 19 '23 23:09 davidhodge931