美文网首页
R基础绘图练习题-190114

R基础绘图练习题-190114

作者: 酷睿_1991 | 来源:发表于2019-01-15 00:49 被阅读0次
    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()
    

    相关文章

      网友评论

          本文标题:R基础绘图练习题-190114

          本文链接:https://www.haomeiwen.com/subject/xcasdqtx.html