I want to add some subscripts and superscripts to my graph labels. I've try expression
, but it doesn't work as I wish with new lines (\n
). I've try to fix it using paste
, but it doesn't work. Below are some of my tries:
par(mfcol=c(1,3))
plot(1,1,main=expression("first line \n second line x"^2))
plot(1,1,main=expression(paste("first line \n second line", "x"^2)))
plot(1,1,main=paste("first line \n second line", expression("x"^2)))
It produces:
In first two pictures the second line is not well centered, in the third one the superscript fails. How to get both centered line and subscripts/superscripts?