gg_remove_grid: Remove grid lines from a plot

Description Usage Arguments Value Examples

Description

gg_remove_grid removes either the major or minor grid lines on either axis.

gg_remove_grid_major Removes grid lines at major breaks

gg_remove_grid_minor Removes grid lines at minor breaks

gg_remove_grid_x Removes grid lines at major and minor breaks on the X axis

gg_remove_grid_y Removes grid lines at major and minor breaks on the X axis

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
gg_remove_grid(plot = last_plot(), major.x = TRUE, major.y = TRUE,
  minor.x = TRUE, minor.y = TRUE)

gg_remove_grid_major(plot = last_plot(), major.x = TRUE, major.y = TRUE)

gg_remove_grid_minor(plot = last_plot(), minor.x = TRUE, minor.y = TRUE)

gg_remove_grid_x(plot = last_plot(), major = TRUE, minor = TRUE)

gg_remove_grid_y(plot = last_plot(), major = TRUE, minor = TRUE)

Arguments

plot

A ggplot2 plot object. By default, the last plot displayed is used.

major.x

Whether or not to remove grid lines at major breakpoints along the X axis (default: TRUE)

major.y

Whether or not to remove grid lines at major breakpoints along the Y axis (default: TRUE)

minor.x

Whether or not to remove grid lines at minor breakpoints along the X axis (default: TRUE)

minor.y

Whether or not to remove grid lines at minor breakpoints along the Y axis (default: TRUE)

Value

A modified ggplot2 plot

Examples

1
2
3
p <- ggplot(mtcars, aes(x = cyl, y = mpg)) +
    geom_point(shape = 1)
gg_remove_grid(plot = p)

briandconnelly/ggplot2bdc documentation built on May 13, 2019, 5:13 a.m.