Skip to contents

Quick functions to enable faster and more readable theme adjustments to ggplot2 when removing gridlines. Functions to do this are as follows:

  • 'gridlines_off' disables all gridlines for a given plot

  • 'gridlines_major_off' disables all major gridlines for a plot

  • 'gridlines_minor_off' disables all minor gridlines for a plot

Usage

gridlines_off()

gridlines_major_off()

gridlines_minor_off()

Value

A ggplot2 theme object

Examples

library(ggplot2)

# Just major gridlines off
ggplot(mtcars, aes(x = mpg, y = hp)) +
  geom_point() +
  gridlines_major_off()


# Just minor gridlines off
ggplot(mtcars, aes(x = mpg, y = hp)) +
  geom_point() +
  gridlines_minor_off()


# All gridlines off
ggplot(mtcars, aes(x = mpg, y = hp)) +
  geom_point() +
  gridlines_off()