【发布时间】:2017-02-04 01:27:36
【问题描述】:
我想知道 mtext() 有什么问题,我无法在我的绘图上方正确显示数字 G?
这是我的 R 代码:
G <- .3333 ## but G can be anything as it comes from a function
curve(dnorm(x),-3,3)
mtext(expression(paste("Medium: ",bold('CT'[12])," = ", round(G,2))),line=3)
【问题讨论】:
-
round 返回一个数字,即 0.3333。您需要将值作为字符或组合它。你不能直接输入:curve(dnorm(x),-3,3) mtext(expression(paste("Medium: ",bold('CT'[12])," = ", ".3333")) ,line=3) 代替?
-
大卫,其实.3333来自一个函数,所以它可以变化!
-
好吧,我好像迷路了,我的错