Y轴标题中的换行

huangapple go评论76阅读模式
英文:

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)"))))

Y轴标题中的换行

英文:

You can try using the atop function:

ggplot(mtcars, aes(wt, mpg)) +
  geom_point() +
  ylab(expression(atop("Cumulative CO" [2] * "", paste("evolved (mg CO" [2]*"-C kg"^-1* "soil)"))))

Y轴标题中的换行

huangapple
  • 本文由 发表于 2023年2月8日 09:36:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/75380606.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定