In R, how to get powers of ten in bold font in a plot label?

Posted by wfoolhill on Stack Overflow See other posts from Stack Overflow or by wfoolhill
Published on 2012-09-19T23:43:53Z Indexed on 2012/09/21 15:38 UTC
Read the original article Hit count: 191

Filed under:
|

I want to have "10^4 points" in bold as my x-axis label.

I know how to make a simple label in bold:

plot(1:10, xlab="")
mtext(text="10 points", side=1, font=2, line=3)

Thanks to this answer, I know how to make a label with a power of ten but nothing is in bold:

mtext(text=expression(paste(10^4, " points")), side=1, font=2, line=3)

Thanks to this answer, I also know how to make a label with a Greek letter in bold:

mtext(text=expression(bold(paste(beta, "=", 10^1, " points"))), side=1, line=3)

But still the power of ten is not in bold!

It doesn't work either with bquote:

mtext(text=bquote(bold(10^1~points)), side=1, line=3)

Any idea?

Here are some details about my system. Let me know if you need anything else.

> sessionInfo()
R version 2.15.0 (2012-03-30)
Platform: x86_64-redhat-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=C                 LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

© Stack Overflow or respective owner

Related posts about r

    Related posts about plot