[英]How to use italics in R graph axis labels
I'm wondering if anyone can help me. 我想知道是否有人可以帮助我。 I have plotted the following graph:
我绘制了以下图表:
visreg(MOD.1, xlab="Distance (m)", ylab="Sciurus vulgaris (Presence/Absence)",
xvar="Distance")
And I would like to make just 'Sciurus vulgaris' in italics. 而且我想用斜体字来制作'Sciurus vulgaris'。 Can anyone help?
有人可以帮忙吗?
Thank you! 谢谢!
Using the example from the documentation of ?visreg
I think the functions expression
and italic
will give you what you need: 使用
?visreg
文档中的?visreg
我认为函数expression
和italic
将为您提供所需的内容:
fit <- lm(Ozone ~ Solar.R + Wind + Temp,data=airquality)
visreg(fit, xlab="Distance (m)",
ylab=expression(italic("Sciurus vulgaris ") (Presence/Absence)))
Output: 输出:
As you can see the y-axis label (only the "sciurus vulgaris") is in italics 如您所见,y轴标签(仅“sciurus vulgaris”)以斜体显示
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.