p <- ggplot(mtcars, aes(mpg, disp)) + geom_line(colour = "blue")
ggdraw(switch_axis_position(p, axis = 'y'))
ggdraw(switch_axis_position(p, axis = 'x'))
ggdraw(switch_axis_position(p + theme_bw(), axis = 'xy', keep = 'x'))
Run the code above in your browser using DataLab