Get plot titles
These functions extract just the titles from a ggplot. get_title()
pulls
the title, while get_subtitle()
pulls the subtitle.
get_title(plot) get_subtitle(plot)
plot |
A ggplot or gtable. |
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))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.