旋转轴和斜体书写

时间:2016-07-23 11:01:34

标签: r

我试图在R中填充一个情节,并且我在旋转xaxis标签时遇到了一些困难,我已经尝试过这个命令:

labels = lablist,srt = 45,pos = 1,xpd = TRUE

但它并不起作用,因为它说它不知道标签。此外,我不知道如何以斜体显示标签名称。

有人有任何建议吗?谢谢:)

1 个答案:

答案 0 :(得分:0)

来自?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)

enter image description here

或者也许:

barplot(setNames(100 * 1:3, nm=c("abc","def","ghi")), las=1, font=3)

enter image description here