I have a question on the plot created with ggplot2 package. Let's say we have such a plot:
df = data.frame(
numbers = seq(1,5),
labels = c(
"Brand",
"Good Brand",
"The Best Brand",
"The Best Brand Today",
"The Best Brand This Month"
)
)
df = df[order(-df$numbers),]
plot = ggplot(data = df, aes(x=labels, y=numbers))+
geom_bar(stat="identity", fill='orange')+
coord_flip()+
labs(
title = "Exemplary title",
caption = "Exemplary caption 1\nExemplary caption number 2"
)+
theme(
plot.title = element_text(hjust = -0.5),
plot.caption = element_text(hjust = -0.5),
panel.spacing = unit(c(0,0,0,20), "cm")
)
plot
Is there any better way to align title and caption to the left side of a picture (not plot, but picture, so in this case there where "The best brand in the world" starts), than making negative vjust values for title and caption?
It is not really the best solution for two reasons: