2011-08-23 48 views
1

我無法設法從條件密度圖(cdplot {graphics})中移除y軸標籤以便稍後水平旋轉它們; axes = FALSE似乎不起作用。任何想法? 謝謝!刪除R條件密度圖中的軸標籤

使用從R文件示例數據:

fail <- factor(c(2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1), 
       levels = 1:2, labels = c("no", "yes")) 
temperature <- c(53, 57, 58, 63, 66, 67, 67, 67, 68, 69, 70, 70, 70, 70, 72, 73, 75, 75, 76, 76, 78, 79, 81) 
cdplot(fail ~ temperature, axes = FALSE) 

Warning messages: 
1: In density.default(x, bw = bw, n = n, ...) : 
    non-matched further arguments are disregarded 
2: In density.default(x[y %in% levels(y)[seq_len(i)]], bw = dx$bw, : 
    non-matched further arguments are disregarded 
+1

如果你提出一些最低限度可重複的代碼和樣本數據的問題,這將是有幫助的。看到這個問題的幫助:http://stackoverflow.com/q/5963269/602276 – Andrie

回答

4

既然你不給我們任何資料,我用了example(spineplot)提供的數據。

您可以通過適當的參數設置爲NA擺脫軸標籤:

spineplot(fail~temperature,yaxlabels=NA) 

但是,如果你想將它們水平排列,你通常設置las=1。不幸的是,spineplot似乎並沒有傳給這一點,所以你需要做的調用par第一:

par(las=1) 
spineplot(fail~temperature) 
+0

非常感謝!它現在工作正常! – neweR