StuA<- c(90,85,93,90,95,90)
StuB <- c(88,79,86,82,92,88)
StuC <- c(77,88,80,85,78,84)
png('Grades.png')
plot(x, StuA, type = 'l', col = 'green', ylim = c(75,100), lwd = 2, ylab= 'Grades') lines(x, StuB, type = 'l', col = 'blue', lwd = 2)
lines(x, StuC, type = 'l', col = 'red', lwd = 2)
legend('topleft', c('StuA','StuB','StuC'), cex=1.3, fill=c('green', 'blue', 'red')) dev.off()
group <- c("A","B","C","D")
legend <- c("x","y","z")
pdf ("barplot.pdf")
barplot(Values,col=colors, names.arg=group, beside=T, hori=T, las=1, xlim=c(0,20)) legend("topright", legend, cex=1.3, fill=colors, box.lty=0)
dev.off()
网友评论