gg_figure_caption: ggplot Figure Caption

View source: R/gg_figure_caption.R

gg_figure_captionR Documentation

ggplot Figure Caption

Description

Add an auto-numbered caption to a ggplot.

Usage

gg_figure_caption(
  caption,
  supplemental = FALSE,
  s.numbers = FALSE,
  caption.width = 98
)

Arguments

caption

A string containing the caption text.

supplemental

Is this a supplemental figure? Defaults to FALSE.

s.numbers

If it is a supplmental figure, how to you want it formatted: "Supplemental Figure 1" (FALSE) or "Figure S1" (TRUE)? Defaults to FALSE.

caption.width

A positive integer giving the target column for wrapping lines in the output. Defaults to 98

See Also

ggplot2::labs, figure.caption, supp.fig.caption

Examples

data(example_data)

ggplot(example.data, aes(x = X, y = Y)) +
  geom_point() +
  gg_figure_caption(caption = "This is a figure")

kstagaman/autoNumCaptions documentation built on Sept. 13, 2022, 12:38 p.m.