本文介绍了你如何制作x-lab标签斜体而不是y-lab标签? (在R中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你如何制作x-lab标签斜体,而不是y-lab标签?我能找到的唯一
命令(font.lab = 3)使得x-lab和y-lab标签都以斜体显示。我在R中创建了具有x和y轴上特定名称的barlot。



pre $ barplot(y,main =主标题,
names = c(a,b,c),
xlab =我希望以斜体显示的文本,
ylab =文本我不想斜体,
font.lab = 3)


解决方案

  barplot(y,main =Main Title,
names = c(a,b,c),
xlab =表达式(斜体(我希望用斜体表示的文本)),
ylab =我不想用斜体表示的文本)

这是一个可能的调用:

 ?plotmath 


How do you make just the x-lab label italics and NOT the y-lab label as well? The onlycommand 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

这篇关于你如何制作x-lab标签斜体而不是y-lab标签? (在R中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 22:04