# First, take a look at the BOD dataBOD#> Time demand#> 1 1 8.3#> 2 2 10.3#> 3 3 19.0#> 4 4 16.0#> 5 5 15.6#> 6 7 19.8par(las = 1) # 纵坐标横排显示barplot( height = BOD$demand, # x轴对应每个柱子的高度数据(BOD 表中 demand 列) names.arg = BOD$Time # 指定每根柱子对应的标签(x轴刻度文字))
library(ggplot2)ggplot(BOD, aes(x = factor(Time), y = demand)) + geom_col()
发表评论