简体   繁体   中英

In ggplot2 theme_bw() doesn't draw back grid lines anymore

Context : R/ggplot2.

If I am not mistaken, theme_bw() used to draw some black gridlines, but with the latest version it doesn't. Is there a way to restore previous situation ?

Check this relatively old question, the grid there is grey, which is also confirmed by the theme definition here . So I suppose it has always been the same.

To "restore" black grid lines, use

qplot(1:10) + 
  theme_bw() + 
  theme(panel.grid.minor = element_line(colour = "black", size = 0.5), 
        panel.grid.major = element_line(colour = "black", size = 0.2))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM