2016-07-23 70 views
0

我想中的R以適應情節,和我有一些掙扎旋轉x軸標籤,我已經嘗試過這個命令:轉軸和斜體書寫

標籤= lablist,SRT = 45, pos = 1,xpd = TRUE

但它不工作,因爲它說它不知道標籤。此外,我不知道如何獲得斜體標籤名稱。

有沒有人有任何建議?謝謝:)

+0

你想用'ggplot2'?它可以很容易地完成它... – Nate

+1

請讓你的例子可重現。它會幫助我們,特別是你想想你遇到的問題。你可以從數據集中模擬數據或芯片塊(更多[提示])(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 –

+0

這只是一個簡單的barplot命令 – user6628798

回答

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