Align axis label on the right with ggplot2

后端 未结 2 1559
野趣味
野趣味 2020-12-16 11:47

Consider the following

d = data.frame(y=rnorm(120), 
               x=rep(c(\"bar\", \"long category name\", \"foo\"), each=40))

ggplot(d,aes(x=x,y=y)) + 
          


        
2条回答
  •  天命终不由人
    2020-12-16 12:15

    Alternatively, flip the axis, your customers will thank you and have less neck pain (plus, I find most boxplots easier to interpret with this orientation):

    ggplot(d, aes(x = x, y = y)) +
      geom_boxplot() + 
      coord_flip()
    

提交回复
热议问题