Is there a solution to control the length of major grid lines in ggplot2? I have a plot here where I'd like the major grid lines to appear on the left of the zero line (just negative values). So for bar "a", only a small portion of the grid line would be visible.
# Some Data
df <- data.frame(trt = c("a", "b", "c"),
outcome = c(-222.3, 121.9, 103.2))
# A plot with major grid lines
ggplot(df, aes(trt, outcome)) +
geom_col() +
coord_flip() +
theme_classic()+
theme(panel.grid.major.y = element_line(color = "blue", size = 1)) +
geom_hline(yintercept = 0, size = 1)