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_background_fill function #67

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

Feature request: easy_background_fill function #67

davidhodge931 opened this issue Sep 19, 2023 · 2 comments

Comments

@davidhodge931
Copy link

davidhodge931 commented Sep 19, 2023

easy_background_fill(what = c("plot", panel", "legend", "key"), to = NULL, teach = FALSE)

where to is the fill 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(plot.background = element_rect(fill = "green")) +
  theme(panel.background = element_rect(fill = "red")) +
  theme(legend.background = element_rect(fill="orange")) +
  theme(legend.key = element_rect(fill = "blue"))
#> Warning: Removed 2 rows containing missing values (`geom_point()`).

Created on 2023-09-20 with reprex v2.0.2

@jonocarroll
Copy link
Owner

That seems to fit the pattern for what ggeasy supports, so I'm on board.

I have a growing list of these to handle that I'll try to coordinate, so no guarantees on timeline, but we'll see. Thanks!

@jonocarroll
Copy link
Owner

Similar: #52

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