Plot with reversed y-axis and x-axis on top in ggplot2

前端 未结 3 2163
误落风尘
误落风尘 2021-01-06 02:43

I\'m trying to get ggplot2 plot with reversed y-axis and x-axis on top. I used scale_y_reverse() to get reversed y-axis but could not figured out h

3条回答
  •  北恋
    北恋 (楼主)
    2021-01-06 03:30

    If you don't want to switch to ggvis just yet, the ggdraw(switch_axis_position(p1 , axis = 'x')) function of the cowplot package works very well.

    https://cran.r-project.org/web/packages/cowplot/vignettes/axis_position.html

提交回复
热议问题