grids: Add Grids to a ggplot

View source: R/grids.R

gridsR Documentation

Add Grids to a ggplot

Description

Add grids to ggplot.

Usage

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

# Load data
data("ToothGrowth")

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

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

kassambara/ggpubr documentation built on Feb. 15, 2023, 4:09 a.m.