add_title: Add plot title or caption

View source: R/add-annotation.R

add_titleR Documentation

Add plot title or caption

Description

Add plot title or caption

Usage

add_title(plot, title = ggplot2::waiver())

add_caption(plot, caption = ggplot2::waiver())

Arguments

plot

A tidyplot generated with the function tidyplot().

title

Title of the plot.

caption

Caption of the plot.

Details

Value

A tidyplot object.

Examples

study |>
  tidyplot(x = treatment, y = score) |>
  add_data_points_beeswarm() |>
  add_title("This is my title")

study |>
  tidyplot(x = treatment, y = score) |>
  add_data_points_beeswarm() |>
  add_caption("This is the fine print in the caption")

# Plotmath expression
study |>
  tidyplot(x = treatment, y = score) |>
  add_data_points_beeswarm() |>
  add_title("$H[2]*O~and~E==m*c^{2}$")


tidyplots documentation built on April 3, 2025, 9:33 p.m.