Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adjusting font.lab to get bold in plotmath expression?

Tags:

r

plotmath

with the following code, xlab will be bold but ylab not. could you please help me

pdf()
par(font.axis=2, font.lab=2, cex.lab=1.2, cex.axis=1.2, cex.sub=1.2,
    mfrow=c(2,2), mar = c(5,6,3,1) + 0.1)
hist(ADAM, axes=F, main="", ylim=c(0,1000000), xlab="",
     ylab= expression(paste("number(",x10^6,")",sep="")))
axis(1,at=seq(0,1,0.2), labels=seq(0,1,0.2))
axis(2, at=seq(0,1000000,500000), labels=seq(0,1, by=0.5), las=2)
dev.off()

Thank you

like image 254
EpiMan Avatar asked Mar 24 '13 15:03

EpiMan


1 Answers

font.lab=2 won't effect axis labels if you use function expression(). You should use function bold() inside expression() to get bold face.

hist (ADAM, axes=F, main="", ylim=c(0,1000000), 
    xlab="", ylab= expression(bold(paste("number(",x10^6,")",sep=""))))
like image 102
Didzis Elferts Avatar answered Oct 19 '22 17:10

Didzis Elferts