Search code examples
rplotmath

Superscript/subscript in R


I would like to have on a plot the following:

enter image description here

I am using this code, but I don't get the expected outcome.

text(4.4,0.5, expression(paste(P[B6.Rag^"-/-"_NOD.Rag^"-/-"], "=2.9x10^-4")), cex = 1.3)

Thanks


Solution

  • How does this look?

    plot(1:10, type="n");
    text(5,5, expression(P[`B6.Rag-/-_NOD.Rag-/-`] == 2.8 %*% 10^-4), cex = 1.3)
    

    enter image description here