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
)Plot title, drawn above the panel.
Subtitle, drawn under the title in a lighter style.
Caption, drawn bottom-right (source notes, methods).
Panel tag (e.g. "A"), drawn top-left — for multi-panel
figures in publications.
Axis titles; override the deparsed aes() expression.
Legend titles for the matching aesthetic.
A Labels object to add to a plot with +.
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