add_title {tidyplots} | R Documentation |
Add plot title or caption
add_title(plot, title = ggplot2::waiver())
add_caption(plot, caption = ggplot2::waiver())
plot |
A |
title |
Title of the plot. |
caption |
Caption of the plot. |
add_title()
and add_caption()
support plotmath expressions to include special characters.
See examples and Advanced plotting.
A tidyplot
object.
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}$")