Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: easy_gridlines_colour function #68

Open
davidhodge931 opened this issue Sep 19, 2023 · 2 comments
Open

Feature request: easy_gridlines_colour function #68

davidhodge931 opened this issue Sep 19, 2023 · 2 comments

Comments

@davidhodge931
Copy link

davidhodge931 commented Sep 19, 2023

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

@jonocarroll
Copy link
Owner

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!

@davidhodge931
Copy link
Author

Likewise a easy_gridlines_linewidth function would be super useful too :)

This is package is a life-saver!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants