条形图不会出现,但会出现x和y轴以及标题

时间:2017-03-16 03:19:16

标签: r

这就是我所拥有的。

barplot(table(ordered(cancer$agecat,
c("Younger than 31","31 to 41","42 to 54","55 or Older"))),
main="Ordered Bar Chart of Age Categorie",ylim=c(0,120),
xlab="Number of People In Each Category")

之前有效,一切都很好但现在没什么了。

1 个答案:

答案 0 :(得分:0)

查看cancer$agecat中的值,这可能就是原因。这是一个有效的例子:

 barplot(runif(4), names.arg = ordered(c("Younger than 31","31 to 41","42 to 54","55 or Older")),
         main="Ordered Bar Chart of Age Categorie",ylim=c(0,1),
         xlab="Number of People In Each Category") 

enter image description here