ggplot axis.title in the same line / column as axis.label

Viewed 132

I would like to move the axis title in ggplot2 into the same column as the axis labels. The y axis title to the top and the x axis title to the right as indicated in the figure.

This would reduce the necessary margin size so that I have more space for the actual figure.

library("ggplot2")

plt <- ggplot(mtcars, aes(wt, mpg)) +
       geom_point() +
       theme(plot.margin = unit(c(2,2,2,2), "cm"))

plot(plt)

Simple image to indicate where the title should go

Thanks for your help.

0 Answers
Related