ggplot2: Splitting facet/strip text into two lines

前端 未结 3 1802
-上瘾入骨i
-上瘾入骨i 2020-12-03 07:30

Consider the following ggplot2 graph with long facet/strip text broken in two lines. The text goes outside the area devoted to facet titles.

library(ggplot2         


        
3条回答
  •  北海茫月
    2020-12-03 08:06

    You can use a 2-line label:

    grp <- c(rep("foo\nbar",3), 1, 1, 1)
    qplot(x=x, y=y) + geom_line() + facet_wrap(~ grp)
    

提交回复
热议问题