In R, using the function barplot
gives me the title centered horizontally over the plot area, not over the whole image.
par(mar=c(3,13,4,2))
barplot(10:1,horiz=T,main='Centralized title',las=1,names.arg=rep(paste0(letters,collapse=''),10))
How can I have the title centered on the whole image instead, like in the image below?
I know I can fiddle with adj
parameter, but it's based on trial and error, the correct value changes with font size, among other problems. Is there a simpler solution?
mtext
par(mar=c(3,13,0,2), oma=c(0,0,3,0))
barplot(10:1,horiz=T,las=1,names.arg=rep(paste0(letters,collapse=''),10))
mtext('Centralized title', outer = TRUE)