2013-03-09 42 views
-2

在前面的問題中,Ananda Mahto告訴我如何創建一個條紋圖,最好是將x座標從0,2,4,6,8,10(在graph1中)更改爲0,1,2 ,3,4,5,6,7,8,9(圖2中)
如何更改它?如何更改帶狀圖中的x座標?

set.seed(1) 
A <- sample(0:10, 100, replace = TRUE) 
stripchart(A, method = "stack", offset = .5, at = .15, pch = 19, 
     main = "Dotplot of Random Values", xlab = "Random Values") 

我想要的是graph2.png不是graph1.png。

的graph1.png

enter image description here

的graph2.png

enter image description here

+3

請閱讀一些基本介紹R基本圖形。 – Roland 2013-03-09 14:22:33

回答

3
A <- sample(0:9, 100, replace = TRUE) 
stripchart(A, method = "stack", offset = .5, at = .15, pch = 19, 
      main = "Dotplot of Random Values", xlab = "Random Values",xaxt="n") 
axis(1, at = 0:9, labels = 0:9)