How to add a subscript on a xlab statement?

416 views Asked by At

I would like to add the following xlab and ylab to my graph but need to have the 10 after the Log as subscript. See my R statement below. How can I modify it to accomplish that? I know you can use the expression command and also add the number in [] but after several trials I did not get it to work as wished.

title (xlab="Log 10 for total ASF genome copies", ylab="Cycle threshold value", outer=TRUE, line=3, family="serif")

1

There are 1 answers

1
Jens Tierling On

You can use paste inside an expression to combine math and plain text:

plot(1:10,
     xlab = expression(paste(Log[10], " for total ASF genome copies")),
     ylab = "Cycle threshold value")

enter image description here

See also ?plotmath.