File: get_title.Rd

package info (click to toggle)
r-cran-cowplot 1.1.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,564 kB
  • sloc: sh: 13; makefile: 5
file content (31 lines) | stat: -rw-r--r-- 618 bytes parent folder | download | duplicates (2)
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))

}