Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

get_title

Get plot titles


Description

These functions extract just the titles from a ggplot. get_title() pulls the title, while get_subtitle() pulls the subtitle.

Usage

get_title(plot)

get_subtitle(plot)

Arguments

plot

A ggplot or gtable.

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))

cowplot

Streamlined Plot Theme and Plot Annotations for 'ggplot2'

v1.1.1
GPL-2
Authors
Claus O. Wilke [aut, cre] (<https://orcid.org/0000-0002-7470-9261>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.