How can you use the atop function in expression()?

旧巷老猫 提交于 2019-12-30 10:52:42

问题


I need to add a line break but I am struggling with the atop function in expression(). The main is the part I would like to break into two lines.

> plot (DAC~Chlo,data=brazilw,
        pch=15,col="red",cex=0.5,
        main=expression("Fig. 3. Relationship
                        between diffuse attenuation coefficient at 490 nm 
                        (K"[d]*") and chlorophyll concentration at three coral
                         reef sites"),
        xlab=expression("Chlorophyll concentration (mg "*m^{-3}*")"),
        cex.lab=0.8,
        cex.main=0.8,
        cex.axis=0.8, 
        font.main=1,
        ylim=c(0,0.3),
        xlim=c(0,3.5), 
        ylab=expression("K"[d]*"(m"*-1^{-1}*")"))

回答1:


You did not specify, where you want to break the string, but this example should help you:

plot(1~1, 
 main=expression(atop("bla bla bla" ~ (K[d]),
                      "bla bla bla")))



来源:https://stackoverflow.com/questions/21066944/how-can-you-use-the-atop-function-in-expression

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!