转轴和斜体书写
问题描述:
我想中的R以适应情节,和我有一些挣扎旋转x轴标签,我已经尝试过这个命令:转轴和斜体书写
标签= lablist,SRT = 45, pos = 1,xpd = TRUE
但它不工作,因为它说它不知道标签。此外,我不知道如何获得斜体标签名称。
有没有人有任何建议?谢谢:)
答
从?par
:(不是你想要的)
'srt' The string rotation in degrees. See the comment about 'crt'. Only supported by 'text'.
与'las'
和'font'
继续:
'las' numeric in {0,1,2,3}; the style of axis labels. 0: always parallel to the axis [_default_], 1: always horizontal, 2: always perpendicular to the axis, 3: always vertical. 'font' An integer which specifies which font to use for text. If possible, device drivers arrange so that 1 corresponds to plain text (the default), 2 to bold face, 3 to italic and 4 to bold italic.
这些可以给你:
barplot(setNames(100 * 1:3, nm=c("abc","def","ghi")), las=2, font=3)
或许:
barplot(setNames(100 * 1:3, nm=c("abc","def","ghi")), las=1, font=3)
你想用'ggplot2'?它可以很容易地完成它... – Nate
请让你的例子可重现。它会帮助我们,特别是你想想你遇到的问题。你可以从数据集中模拟数据或芯片块(更多[提示])(http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example))。请注意,所有这些问题都可能在(R有145000个问题)之前得到解答,例如:http://stackoverflow.com/questions/8975797/how-do-you-make-just-the-x-lab- label-italics-and-not-the-y-lab-label-as-well-i –
这只是一个简单的barplot命令 – user6628798