문제

How do you make just the x-lab label italics and NOT the y-lab label as well? The only command I can find (font.lab=3) makes both the x-lab and y-lab labels italics. I am creating barplots in R that have specific names on the x and y axis.

barplot(y, main="Main Title",
    names=c("a", "b", "c"),
    xlab="Text that I would like to be in italics",
    ylab="Text that I do NOT want to be in italics",
    font.lab=3)
도움이 되었습니까?

해결책

 barplot(y, main="Main Title",
     names=c("a", "b", "c"),
     xlab=expression(italic("Text that I would like to be in italics")),
     ylab="Text that I do NOT want to be in italics")

That is a plotmath call:

?plotmath
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top