How do you make just the x-lab label italics and NOT the y-lab label as well? (in R)

﹥>﹥吖頭↗ 提交于 2019-12-23 02:18:39

问题


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)

回答1:


 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


来源:https://stackoverflow.com/questions/8975797/how-do-you-make-just-the-x-lab-label-italics-and-not-the-y-lab-label-as-well-i

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!