In ggplot2, how to put the plot title at the bottom of the plot.
qplot(rnorm(100)) + ggtitle(\"My Title\")
puts the title at middle and top
With the dev version you can use the caption argument,
ggplot() +
labs(caption="Bottom Title") +
theme(plot.caption = element_text(hjust=0.5, size=rel(1.2)))
Alternatively, wrap the plot in grid.arrange(),
gridExtra::grid.arrange(ggplot(), bottom="Bottom Title")
Here is a solution using grid.text
:
library("grid")
qplot(rnorm(100)) + theme(plot.margin=unit(c(0.5, 1, 2, 0.5), "lines"))
grid.text("My Title", x = unit(0.5, "npc"), y = unit(0, "npc"),
vjust = -0.5, gp = gpar(cex=1.2))