add_facet: Add a facet label to a ggplot object which only contains 1...

Description Usage Arguments Value Author(s) Examples

View source: R/add_facet.R

Description

Add a facet label to a ggplot object which only contains 1 panel

Usage

1
2
3
4
5
6
7
8
9
add_facet(
  p,
  label,
  fill = "#7fc97f",
  color = "black",
  size = 14,
  face = "bold",
  r = 0.25
)

Arguments

p

the ggplot2 object to be added

label

the text to be added as a facet label

fill

the strip background color

color

the color of the text

size

the size of the text, default size is 14

face

the font face of the text

r

the radius of the rounded corners, a unit object, default is unit(0.1, 'snpc').

Value

a ggplot2 object with a facet label

Author(s)

Zhonghui Gai

Examples

1
2
p <- ggplot(mtcars, aes(disp, drat)) + geom_point()
ggfacet::add_facet(p, label = "test\n (mg/L)\n p = 0.01")

ZhonghuiGai/ggfacet documentation built on Dec. 18, 2021, 8:28 p.m.