服务热线
178 0020 3020
No.2
将工作目录改到D:/R语言学习资料/R group task 2
2.1折线图(一)
a<-c(0,10,20,30,40,50)
b<-c(100,200,400,350,200,50)
png("不同亮氨酸浓度处理与细胞增殖数目的情况",width=480,height=480)
plot(a,b,type="o",xlab="Leu浓度",ylab="增殖数目",main="不同亮氨酸浓度处理与细胞增殖数目的情况", col="green",col.lab="blue",col.axis="red")
dev.off()
2.2折线图(二)
a<-c(198,93,210,320,127,260)
b<-c(332,210,467,882,156,960)
d<-c(1:6)
png("Expense",width=480,height=480)
plot(d,a,type="b", ylim=c(0,1000),xlab="month",ylab="RMB",main="Expense",
col="blue",col.lab="blue",col.axis="black")
points(d,b, type="b", col="red")
dev.off()
2.3直方图
a<-c(23.7,45.3,67.5,55.2,30.9,41.8,64.7,57.4,26.5,35.2,44.0,63.1,52.3, 32.8, 38.2) # draw histogram
png("Histogram of W",width=480,height=480)
hist(a,col="green",freq=F,xlab="W",ylab="Density",main="Histogram of W")
lines(density(a),lwd=2,col="red")
dev.off()
附件