Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to add exponent value to x title

Having issue adding space,
I am using the following to name my x and y title.

labs(y = "% biomass", x = expression(paste("Mulch amount", tha^{-1})))

It’s resulting in no space between mulch amount and tha (making it Mulchamounttha(-1).

Does anyone know how to add space in between using the same code style?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

From ?plotmath

‘x ~~ y’ put extra space between x and y

plot(0:1, 0:1, xlab = expression("Mulch amount"~~tha^{-1}))

Or you could include the space in your string

plot(0:1, 0:1, xlab = expression("Mulch amount "*tha^{-1}))

(since the * operator does juxtaposition, I often use it as a shortcut for paste())

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading