英文:
Line break in y axis title
问题
I want the y axis labe in two rows; line break after evolved
在演化后,我希望Y轴标签分成两行,即"evolved"之后换行。
英文:
I want the y axis labe in two rows; line break after evolvedI am having problem in getting the line break in y axis title. It contains suprescript and subscript and I am using following code:
ylab(bquote("Cumulative CO" [2] * " evolved (mg CO" [2]*"-C kg"^-1* "soil)")) +
xlab("Incubation time (days)") +
I want line break after evolved. I have tried using \n and cannot get the desired result.
ylab(bquote("Cumulative CO" [2] * " evolved (mg CO" [2]*"-C kg"^-1* "soil)")) +
xlab("Incubation time (days)")
I tried \n
but I get "evolved" in the upper row and other sentence in the second row.
答案1
得分: 1
你可以尝试使用atop函数:
ggplot(mtcars, aes(wt, mpg)) +
geom_point() +
ylab(expression(atop("Cumulative CO"[2] * "", paste("evolved (mg CO"[2]*"-C kg"^-1* "soil)"))))
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论