-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
Description
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:
Lines 499 to 500 in b87a6e3
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.
EvaMaeRey