我想在我的 bquote
中有一个新行环境,我该怎么做?
我的代码:
test<-c(1,2,3,4,4.5,3.5,5.6)
test2<-0.033111111
plot(test,c(1:length(test)))
segments(4,0,4,23,col="red",lwd=2)
text(5, 4.5, labels = bquote(Qua[0.99] == .(round(test2,4))),col="red", cex = 1.4)
我想在等号之后有一个新行,所以这应该给出:
VaR_0.99 =
0.03311
and not
VaR_0.99 = 0.03311
我用线条试过了,但没有用:
test<-c(1,2,3,4,4.5,3.5,5.6)
test2<-0.033111111
lines<-list(bquote(Qua[0.99] == ),bquote(.(round(test2,4))))
plot(test,c(1:length(test)))
segments(4,0,4,23,col="red",lwd=2)
text(5, 4.5, labels =lines ,col="red", cex = 1.4)
最佳答案
例如,使用 atop
:
test<-c(1,2,3,4,4.5,3.5,5.6)
test2<-0.033111111
plot(test,c(1:length(test)))
segments(4,0,4,23,col="red",lwd=2)
text(5, 4.5,
labels = bquote(atop(Qua[0.99] == phantom(), .(round(test2,4)))),
col="red", cex = 1.4)
关于r - 如何在与 `bquote` 一起使用的 `text` 表达式中换行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15663535/