服务热线
178 0020 3020
任务1
代码
x<-c(1,2,3,4,5,6)
y<-c(7,12,5,20,16,10)
barplot(y,xlab='Month',ylab='Revenue',main='Revenue chart',col='blue',border='red',names.arg=x)
结果附件1
任务2
代码
a<-read.csv('DATA2.csv',header=F)
M<-c(1,2,3,4,5,6)
barplot(as.matrix(a[,1:6]),beside=F,names.arg=M, xlab = "月份",ylab = "营业额",main = "2017年上半年总收入",
col = c("yellow","orange", "red"))
legend("topleft",c("一部","二部","三部"),fill = c("yellow","orange", "red"))
数据存为Excel
2 | 4 | 1 | 6 | 5 | 2 |
2 | 5 | 2 | 7 | 6 | 2 |
3 | 3 | 1 | 7 | 5 | 6 |
结果 附件2
附件