rstudio / thematic

Theme ggplot2, lattice, and base graphics based on a few simple settings.
https://rstudio.github.io/thematic/
Other
244 stars 10 forks source link

Include ggplot2 legend colors for size and shape aesthetics in theming #127

Open uhkeller opened 2 years ago

uhkeller commented 2 years ago

ggplot2 legend symbols for shape and size are not changed from their default black color when a theme is applied, which in effect renders them almost invisible when using a dark theme. It would be great if legend aesthetics could be included in theming.

library(thematic)
thematic_on("black", "white", "orange")
library(ggplot2)
# Legend symbols are black and almost invisible
ggplot(iris, aes(Sepal.Length, Petal.Length, shape = Species)) +
  geom_point()

# Manually correcting them works
ggplot(iris, aes(Sepal.Length, Petal.Length, shape = Species)) +
  geom_point() +
  guides(shape = guide_legend(override.aes = list(color = thematic_get_option("fg"))))

Created on 2022-09-06 with reprex v2.0.2

(I really hope this package isn't abandoned though it certainly looks like it…)

cpsievert commented 10 months ago

I really hope this package isn't abandoned

Not abandoned, just not a priority at the moment. I'd be happy to review a PR to make this improvement, but I'm also not sure ggplot2 currently gives us the tools we'd need to make this a possibility in {thematic}