ggeasy
ggeasy copied to clipboard
Feature request: `easy_background_fill` function
trafficstars
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
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!
Similar: #52