标签:
x = c(7,5,8)
dim(x)<-3
names(x)<-c("apple","banana", "cherry")
plot(x, type="b",xaxt="n", xlab="fruits",ylab="number")
axis(1,1:3,labels = names(x))
#矢量表示
x = c(7,5,8)
names(x)<-c("apple","banana", "cherry")
plot(as.vector(x), type="b",xaxt="n", xlab="fruits",ylab="number")
axis(1,1:3,labels = names(x))
标签:
原文地址:http://www.cnblogs.com/xinping-study/p/4721303.html