This function provides a simple way to modify the background grid in ggplot2. It
doesn't do anything that can't be done just the same with theme()
. However, it simplifies
creation of the most commonly needed variations.
background_grid(major = c("xy", "x", "y", "only_minor", "none"),
minor = c("xy", "x", "y", "none"), size.major = 0.2, size.minor = 0.5,
colour.major = "grey90", colour.minor = "grey98")
Specifies along which axes you would like to plot major grid lines. Options are "xy", "x", "y", "only_minor" (disables major grid lines but allows you to switch on minor grid lines), "none".
Specifies along which axes you would like to plot minor grid lines. Options are "xy", "x", "y", "none".
Size of the major grid lines.
Size of the minor grid lines.
Color of the major grid lines.
Color of the minor grid lines.