美文网首页
ggplot2 相关 2020-05-05

ggplot2 相关 2020-05-05

作者: SnorkelingFan凡潜 | 来源:发表于2020-05-05 20:07 被阅读0次

All ggplot2 plots begin with a call to ggplot(), supplying default data and aesthethic mappings, specified by aes().
You then add layers, scales, coords and facets with +.
To save a plot to disk, use ggsave()


示例

library(ggplot2)
table=read.table("kaks.result.table",sep="\t",header=T)
pdf(file="ka2.pdf")
ggplot(table,aes(x=gene,y=ka,fill=gene))+geom_boxplot()+labs(x="Genes",y="Ka")
dev.off()
pdf(file="ks2.pdf")
ggplot(table,aes(x=gene,y=ks,fill=gene))+geom_boxplot()+labs(x="Genes",y="Ks")
dev.off()
pdf(file="kaks2.pdf")
ggplot(table,aes(x=gene,y=kaks,fill=gene))+geom_boxplot()+ylim(0, 5)+labs(x="Genes",y="Ka/Ks")
dev.off()

相关文章

网友评论

      本文标题:ggplot2 相关 2020-05-05

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