Open ASKurz opened 1 year ago
Here's a more radical option:
mtcars %>%
ggplot(aes(mpg, wt)) +
geom_point(aes(shape = factor(cyl))) +
theme_barbie() +
theme(legend.background = element_rect(fill = "white"),
legend.key = element_rect(fill = barbie_theme_colors["panel"]))
I actually very much like the "radical" one. I will add this. This one is a bit tedious so I will probably do this tomorrow. I will follow up on this issue once it is done. Thanks for finding these flaws, Solomon!
Glad to be of service.
Update: To get it right, I think it might have to be this:
mtcars %>%
ggplot(aes(mpg, wt)) +
geom_point(aes(shape = factor(cyl))) +
theme_barbie() +
theme(legend.background = element_rect(fill = "white"),
# note we're adjusting both fill and color settings
legend.key = element_rect(fill = barbie_theme_colors["panel"],
color = barbie_theme_colors["panel"]))
totally forgot to come back to this... @christopherkenny or @lukepilling, is this worth implementing?
Seems like yes for Barbie. Would we need to check the other themes to make sure it didn't look "bad"? Or just implement the solution throughout?
Idk that seems like a huge pain. Probably implementing it in Barbie would be fine for now. Unless you or Chris want to try to implement it across the board. I don't think it is necessary for now though
FYI, we could clean this up if we have specific choices, but ggplot2 version 3.5.0 has this as a breaking change (which fixes the ugly greys)/
We can see how that looks below: themes_test.pdf
And here's a png version, since it doesn't show as pdf.
I think you're gonna want to adjust the
fill
setting for thelegend.key
fortheme_barbie()
. Here's an example of what currently happens:See the default gray background in the legend key? Here are two possible fixes: