removeGrid

0th

Percentile

Remove grid lines from ggplot2

Remove grid lines from a ggplot2 plot, to have a cleaner and simpler plot

Usage
removeGrid(x = TRUE, y = TRUE)

removeGridX()

removeGridY()
Arguments
x
Whether to remove grid lines from the x axis.
y
Whether to remove grid lines from the y axis.
Details

Minor grid lines are always removed. removeGrid removes the major grid lines from the x and/or y axis (both by default). removeGridX is a shortcut for removeGrid(x = TRUE, y = FALSE) removeGridY is a shortcut for removeGrid(x = FALSE, y = TRUE)

Value

  • A ggplot2 layer that can be added to an existing ggplot2 object.

Aliases
  • removeGrid
  • removeGridX
  • removeGridY
Examples
if (requireNamespace("ggplot2", quietly = TRUE)) {
  df <- data.frame(x = 1:50, y = 1:50)
  p <- ggplot2::ggplot(df, ggplot2::aes(x, y)) + ggplot2::geom_point()
  p + removeGrid()
  p + removeGrid(y = FALSE)
  p + removeGridX()
}
Documentation reproduced from package ggExtra, version 0.1.5.2, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.