I am creating following graph on ggplot and need to annotate some info on each graph as subtitle, the graph looks like this:
For title and subtitle purposes, I wrote the following code:
plot.title <- "Link A"
Common <- paste("Percentage:", "10%", sep=" ")
Average <- paste("Average:", "83", sep= " ")
plot.subtitle <- paste(Common, AverageSearchSpace, sep="\n")
and add this in ggplot as:
ggtitle(bquote(atop(.(plot.title), atop(.(plot.subtitle), ""))))
Yet as it can be seen the titles are overlapping currently and i could not find a way to re-position them without overlapping.
I was wondering what the solution to separate the overlapping titles is. I tried to increase the plot margin in theme() with:
theme(plot.margin = unit(c(2, 2, 2, 2), "cm")
However, this did not help.
Also, I tried the following:
plot.title = element_text(size = 85,colour="black", vjust = -2)
This seems to adjust all of the title's position rather than subtitle and title separately.
Also, I could not find any command in theme() such as plot.subtitle to arrange its position. It seems it does not exist.
Any help code piece or related link is appreciated. Thanks.