Hi this simple code (and all my scripts from this morning) has started giving me a off center title in ggplot2
Ubuntu version: 16.04
R studio version: Versi
From the release news of ggplot 2.2.0: "The main plot title is now left-aligned to better work better with a subtitle". See also the plot.title argument in ?theme: "left-aligned by default".
As pointed out by @J_F, you may add theme(plot.title = element_text(hjust = 0.5)) to center the title.
ggplot() +
ggtitle("Default in 2.2.0 is left-aligned")
ggplot() +
ggtitle("Use theme(plot.title = element_text(hjust = 0.5)) to center") +
theme(plot.title = element_text(hjust = 0.5))