美文网首页
ggplot2:堆积柱形图

ggplot2:堆积柱形图

作者: Mr_我爱读文献 | 来源:发表于2020-01-13 22:07 被阅读0次

    输入文件格式如下:


    library(ggplot2)
    setwd("C:/Users/lenovo/Desktop")
    data <- read.csv(file="111.csv",header = T)
    
    ggplot(data=data, aes(x=Species, y=Value, fill=Type)) + 
    +     geom_bar(stat="identity") +
    +     facet_grid(~Soft) + 
    +     labs(title="Prediction of Disease-related Mutations.", x="", y="Percentage of deleterious mutations", fill="Type") + 
    +     theme(plot.title = element_text(size=25, margin=margin(t=20, b=30)))
    
    

    参考链接:
    http://theduke.at/blog/science/beginners-guide-to-creating-grouped-and-stacked-bar-charts-in-r-with-ggplot2/
    https://stackoverflow.com/questions/21409850/generate-paired-stacked-bar-charts-in-ggplot-using-position-dodge-only-on-some

    相关文章

      网友评论

          本文标题:ggplot2:堆积柱形图

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