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))

05-11 23:01