Add line break to axis labels and ticks in ggplot

后端 未结 5 906
难免孤独
难免孤独 2020-11-29 03:10

I\'m looking for a way to use long variable names on the x axis of a plot. Of course I could use a smaller font or rotate them a little but I would like keep them vertical a

5条回答
  •  日久生厌
    2020-11-29 03:24

    In addition to Joe's answer this also works

    myplot + scale_x_discrete(labels = c("Ambystoma\nmexicanum")
    

提交回复
热议问题