<span style="font-size:18px;">library(ggplot2)
pathway = read.table("C://Users//Desktop//path.richFactor.head20.tsv",header=T,sep="\t")
# 画图
p = ggplot(pathway,aes(R0vsR3/All_Unigene,Pathway))
p=p + geom_point()
# 改变点的大小
p=p + geom_point(aes(size=R0vsR3))
# 四维数据的展示
pbubble = p + geom_point(aes(size=R0vsR3,color=-1*log10(Qvalue)))
# 自定义渐变颜色
pbubble =pbubble+ scale_colour_gradient(low="green",high="red")
# 绘制pathway富集散点图
pr = pbubble + labs(color=expression(-log[10](Qvalue)),size="Gene number", x="Rich factor",y="Pathway name",title="Top20 of pathway enrichment")
# 改变图片的样式(主题)
pr=pr + theme_bw()
pr
#pr</span>