hist(data$MEDV,col="grey")#可以看到目标数据的总体分布
legend(35,170,c("min:5","median:21.2","mean:22.51","max:50"),fill=c("lightblue","wheat"))

R语言给直方图加标签_编程开发