1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/get_titles.R
\name{get_title}
\alias{get_title}
\alias{get_subtitle}
\title{Get plot titles}
\usage{
get_title(plot)
get_subtitle(plot)
}
\arguments{
\item{plot}{A ggplot or gtable.}
}
\description{
These functions extract just the titles from a ggplot. \code{get_title()} pulls
the title, while \code{get_subtitle()} pulls the subtitle.
}
\examples{
library(ggplot2)
p <- ggplot(mpg, aes(displ, cty)) +
geom_point() +
labs(
title = "Plot title",
subtitle = "Plot subtitle"
)
ggdraw(get_title(p))
ggdraw(get_subtitle(p))
}
|