grids: Add Grids to a ggplot

Description Usage Arguments Examples

View source: R/grids.R

Description

Add grids to ggplot.

Usage

1
grids(axis = c("xy", "x", "y"), color = "grey92", size = NULL, linetype = NULL)

Arguments

axis

axis for which grid should be added. Allowed values include c("xy", "x", "y").

color

grid line color.

size

numeric value specifying grid line size.

linetype

line type. An integer (0:8), a name (blank, solid, dashed, dotted, dotdash, longdash, twodash). Sess show_line_types.

Examples

1
2
3
4
5
6
7
8
9
# Load data
data("ToothGrowth")

# Basic plot
p <- ggboxplot(ToothGrowth, x = "dose", y = "len")
p

# Add border
p + grids(linetype = "dashed")

Example output

Loading required package: ggplot2
Loading required package: magrittr

ggpubr documentation built on July 2, 2020, 2:12 a.m.