I want to display a relatively long tag and do not want this tag to consume space for the chart.
Example:
library(ggplot2)
out <- ggplot(economics, aes(x=date,y=unemploy)) +
geom_line() +
labs(title="US unemployment rate",
subtitle="(%)",
caption="Source: St. Louis Fed.\n Last observation: April 2014.",
tag="us_unempl.pdf (last update: 2019-01-15, 22:30)") +
theme(plot.caption=element_text(hjust=0),
plot.tag=element_text(size=rel(1)),
plot.tag.position="bottomright")
print(out)
In this example, the relatively wide tag results in a substantial loss of space for the actual chart, because the chart's right margin is moving to the left.
How can I display the tag below the chart - ideally just opposite of the caption's second line or, alternatively, aligned to the right margin of the plot below the caption?
Note: I need the caption for other information (such as in my example), otherwise it would obviously be a natural solution to use hjust=1 in plot.caption.