This was brought to my attention by @EvaMaeRey. Currently, we have the following situation where we cannot easily switch on the grid in theme_classic(). In the plot below, we would expect green gridlines.
library(ggplot2)
p <- ggplot(mpg, aes(displ, hwy)) +
geom_point() +
theme_classic()
p + theme(panel.grid = element_line(colour = "limegreen"))

Created on 2025-02-05 with reprex v2.1.1
This is because theem_classic() sets the child elements to blank:
|
panel.grid.major = element_blank(), |
|
panel.grid.minor = element_blank(), |
Whereas it would make more sense to set the parent panel.grid to blank and let child elements inherit the usual route.
This was brought to my attention by @EvaMaeRey. Currently, we have the following situation where we cannot easily switch on the grid in
theme_classic(). In the plot below, we would expect green gridlines.Created on 2025-02-05 with reprex v2.1.1
This is because
theem_classic()sets the child elements to blank:ggplot2/R/theme-defaults.R
Lines 499 to 500 in b87a6e3
Whereas it would make more sense to set the parent
panel.gridto blank and let child elements inherit the usual route.