align_titles: Horizontally align ggplot2 title and subtitle

View source: R/plot_tools.R

align_titlesR Documentation

Horizontally align ggplot2 title and subtitle

Description

Horizontally align ggplot2 title and subtitle

Usage

align_titles(align = 0)

Arguments

align

Horizontal alignment. 0 left-aligns, 1 right-aligns, 0.5 centers.

Value

A ggplot2 theme object.

Examples


# library(ggplot2)
# ggplot(mpg, aes(manufacturer, cty)) + geom_boxplot() +
#     labs(title = "This is a title", subtitle = "This is a subtitle") +
#     align_titles(align = 0.5)

#> A plot with the title and subtitle centered.


DesiQuintans/desiderata documentation built on April 9, 2023, 5:43 a.m.