I'm using the R package ggtext to "plot align" (max left align) my title and subtitle. I also want to use these ggtext methods to "plot align" my caption.
library(tidyverse)
library(ggtext)
ggplot(mpg, aes(cty, hwy)) +
geom_point() +
theme(plot.title.position = "plot",
plot.caption.position = "plot",
plot.title = element_markdown(),
plot.subtitle = element_markdown(),
plot.caption = element_markdown()) +
labs(title = "This is the title.",
subtitle = "This is the subtitile.",
caption = "This is the caption.")
You'll probably notice the caption is right aligned, whereas the title and subtitle are "plot aligned".

How do I "plot align" my caption?
For the benefit of others, you can left align the caption in ggplot2 in the following way:
library(ggplot2)
ggplot(mpg, aes(cty, hwy)) +
geom_point() +
theme(plot.caption = element_text(hjust = 0)) + # set the left align here
labs(title = "This is the title.",
subtitle = "This is the subtitile.",
caption = "This is the caption.")

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With