Easily adjust ggplot2 major gridlines
gridlines_major.RdA simple function to easily adjust the ggplot gridlines. This acts as a wrapper for the theme elements and is a little more user friendly.
Usage
gridlines_major(
size = 0.5,
color = "#d6d6d6",
linetype = "solid",
lineend = NULL,
colour = NULL
)Examples
library(ggplot2)
df <- data.frame(x = factor(rep(letters[1:3], each = 10)),
y = rnorm(30),
color = rep(c("A", "B"), each = 5))
ggplot(df, aes(x = x, y = y, color = color)) +
geom_point() +
gridlines_major(size = 4, color = "pink")
#> Warning: The `size` argument of `element_line()` is deprecated as of ggplot2 3.4.0.
#> ℹ Please use the `linewidth` argument instead.
#> ℹ The deprecated feature was likely used in the emwthemes package.
#> Please report the issue to the authors.