-2

在前一个问题中,Ananda Mahto 告诉我如何创建条形图,
最好将 x 坐标从 0,2,4,6,8,10(在 graph1 中)更改为 0,1,2,3,4 ,5,6,7,8,9(在graph2中)
如何改变它?

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

在此处输入图像描述

graph2.png

在此处输入图像描述

4

1 回答 1

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)
于 2013-03-09T14:21:10.783 回答