Reverse and change limit of axis

后端 未结 1 1440
忘掉有多难
忘掉有多难 2020-12-06 04:16

I am trying to create a contour plot. I would like to have depth on the Y-axis and time on the X-axis. Right now this is the code that I am using:

par <-          


        
相关标签:
1条回答
  • 2020-12-06 04:46

    As @aosmith already pointed out, just use the lim inside the scale_y_reverse

    library(ggplot2)
    set.seed(15)
    
    ggplot(data.frame(x=sort(runif(20, 0, 20)), y=cumsum(runif(20,0 ,2))), aes(x,y)) +
        geom_point() + 
        scale_y_reverse( lim=c(10,0))
    

    enter image description here

    0 讨论(0)
提交回复
热议问题