简体   繁体   English

R中的上标和下标

[英]Superscript and subscript in R

I was trying to do a super script after a subscript. 我试图在下标之后创建一个超级脚本。 See image. 见图片。 But with this code: 但是用下面的代码:

xlab=expression(-log ~ K[TX]^{-1})

it put the supercript above K instead of after the TX. 它将超级脚本放在K之上,而不是在TX之后。 so basically I want the -1 to be the supercript of the whole (K[TX])^-1. 所以基本上我希望-1是整个(K [TX])^-1的超脚本。 Does anyone know how to do that? 有谁知道这是怎么做到的吗?

图片

This should do 这应该做

xlab=expression(-log ~ {K[TX]}^{-1})

or, alternatively: 或者,或者:

xlab=expression(-log ~ K[TX^{-1}])

The second is exactly what you are asking for, but it may be more difficult to read. 第二个正是您要的,但是可能更难阅读。

Test them here 在这里测试

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM