How to make beta italic and bold in axis label and P italic and bold in text

后端 未结 1 899
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-07 05:05
x<-c(0.2,0.4,0.8,2.3)
y4<-c(190.66,185.55,188.53,187.51)
par(mar=c(2.0,4.5,0.5,2.5))
plot(x,y4,type=\"l\",xaxt=\"n\",yaxt=\"n\",col=\"navy\",frame=F,lwd=2,
 xl         


        
相关标签:
1条回答
  • 2020-12-07 05:20

    From the ?plotmath help page

    Note that bold, italic and bolditalic do not apply to symbols, and hence not to the Greek symbols such as mu which are displayed in the symbol font. They also do not apply to numeric constants.

    also from the ?plotmath help page

    Any Unicode character can be entered into a text string via a \uxxxx escape, or used by number in a call to points. The windows family of devices can display such characters if they are available in the font in use. This can often be used to display Greek letters in bold or italic.

    Thus you can plot the beta with

    plot(x,y4,type="l",xaxt="n",yaxt="n",col="navy",frame=F,lwd=2,
     xlab="levels(ppm)",xlim=c(0,2.5),ylim=c(185,195), font.lab=2 ,
     ylab=expression(bold("HOMA-")~bolditalic("\u03B2")~bold("(%)"))
     )
    

    and you can use an expression for the "P" in the text

    text(2.0,192, expression(bolditalic(P)~bold("for trend<0.01")),cex=0.75)
    

    enter image description here

    0 讨论(0)
提交回复
热议问题