R ggplot y轴标题上的第二行不工作

R ggplot y轴标题上的第二行不工作,r,ggplot2,R,Ggplot2,无论我如何尝试使用运算符,似乎都无法获得第二行。我想要一些文本,测试在第二行。有没有办法让这一切顺利进行 ytitle <- expression(bold(paste("Chlorophyll", italic(" a "), "(",mu, gL^-1,")", "\n TEST"))) ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point(size=2, shape=23) + labs(y=ytitle) 你可以用它 atop("abo

无论我如何尝试使用运算符,似乎都无法获得第二行。我想要一些文本,测试在第二行。有没有办法让这一切顺利进行

ytitle <- expression(bold(paste("Chlorophyll", italic(" a "), "(",mu, gL^-1,")", "\n TEST")))

ggplot(mtcars, aes(x=wt, y=mpg)) +
  geom_point(size=2, shape=23) + labs(y=ytitle)
你可以用它

atop("above", "below")
把你的头发换成这个

ytitle <- expression(bold(atop(paste("Chlorophyll", italic(" a "), "(",mu, gL^-1,")"), "\n TEST")))

我的解决方案在这里,谢谢

ggplot(mtcars, aes(x=wt, y=mpg)) +
      geom_point(size=2, shape=23) + labs(y=expression(atop(paste("Chlorophyll", italic(" a "), "(",mu, gL^-1,")"), "TEST")))

请添加一个样本数据,以便我们可以复制您的结果。为什么不使用labsy=PasteChlore\nTEST。请注意,我删除了其中的大部分实际文本,只是为了保持其作为注释的简单性,直到您形成正确的问题后,我可以将其表述为正确的答案,,TEST@anotherFishGuy你的答案是我唯一能找到工作的答案,谢谢!谢谢,这个很好用!我试过了,但一定是出了什么问题!