One option is to rotate the graphics viewport, but then have the axis labels in the plot rotated in the opposite direction.
EDIT: Added title to plot
library("ggplot2")
library("grid")
g <- ggplot(mtcars, aes(x = hp, y = mpg)) +
geom_point() +
theme(axis.title.x = element_text(angle = -45,
hjust = 0.5, vjust = 0.5),
axis.title.y = element_text(angle = -45,
hjust = 0.5, vjust = 0.5))
g <- g + annotation_custom(
grob = textGrob(label = "The infamous mtcars dataset", rot = -45,
x = unit(1.1, "npc"), y = unit(1.1, "npc")))
print(g, vp = viewport(width = unit(0.5, "npc"),
height = unit(0.5, "npc"), angle = 45))
