Every argument is optional; only the ones you supply are changed, so labs() can be added repeatedly to build up a title block.

labs(
  title = NULL,
  subtitle = NULL,
  caption = NULL,
  tag = NULL,
  x = NULL,
  y = NULL,
  color = NULL,
  size = NULL,
  fill = NULL
)

Arguments

title

Plot title, drawn above the panel.

subtitle

Subtitle, drawn under the title in a lighter style.

caption

Caption, drawn bottom-right (source notes, methods).

tag

Panel tag (e.g. "A"), drawn top-left — for multi-panel figures in publications.

x, y

Axis titles; override the deparsed aes() expression.

color, size, fill

Legend titles for the matching aesthetic.

Value

A Labels object to add to a plot with +.

Examples

ggnext(cars, aes(speed, dist)) +
  geom_point() +
  labs(
    title = "Stopping distance rises with speed",
    subtitle = "1920s road tests, 50 observations",
    x = "Speed (mph)",
    y = "Stopping distance (ft)",
    caption = "Source: datasets::cars"
  )
#> <ggnext plot>
#>   data:  50 x 2
#>   aes:   x = speed, y = dist
#>   layers: 1 
#>   coord: cartesian
#>   mode:  static