更新时间:2023-11-26 13:22:52
From ggplot 2.2.0
you can set the position of the axes with the position
argument in scale_
:
ggplot(mpg, aes(displ, hwy)) +
geom_point() +
scale_x_continuous(position = "top") +
scale_y_continuous(position = "right")