rm(list=ls()) library(ggplot2) library(Cairo) setwd("D:/R_for_lm/LM_Shengxinwenzhangzhuanxie/52MRNA_KEGGandGO") GO_BP<-read.csv("GO_BP_pxiaoyu0.05qian10.csv",header=TRUE,sep=",") png_path="./figure/GO_BP.png" CairoPNG(filename="png_path.png", width=11000,height=6000,dpi=1000) ggplot(data=GO_BP)+ geom_bar(aes(x=reorder(Term,Count),y=Count, fill=-log10(PValue)), stat='identity') + coord_flip() + scale_fill_gradient(expression(-log["10"](P.value)),low="blue", high = "red") + xlab("") + ylab("Gene count") + scale_y_continuous(expand=c(0, 0))+ theme( axis.text.x=element_text(color="black",size=rel(1.5)), axis.text.y=element_text(color="black", size=rel(1.5)), axis.title.x = element_text(color="black", size=rel(1.6)), legend.text=element_text(color="black",size=rel(1.2)), legend.title = element_text(color="black",size=rel(1.6)) # legend.position=c(0,1),legend.justification=c(-1,0) # legend.position="top", ) dev.off() rm(list=ls()) library(ggplot2) library(Cairo) setwd("D:/R_for_lm/LM_Shengxinwenzhangzhuanxie/52MRNA_KEGGandGO") GO_CC<-read.table("GO_CC_pxiaoyu0.05.csv",header=TRUE,sep=",") png_path="./figure/GO_CC.png" CairoPNG(filename="png_path.png", width=10000,height=6000,dpi=1000) ggplot(data=GO_CC)+ geom_bar(aes(x=reorder(Term,Count),y=Count, fill=-log10(PValue)), stat='identity') + coord_flip() + scale_fill_gradient(expression(-log["10"](P.value)),low="blue", high = "red") + xlab("") + ylab("Gene count") + scale_y_continuous(expand=c(0, 0))+ theme( axis.text.x=element_text(color="black",size=rel(1.5)), axis.text.y=element_text(color="black", size=rel(1.5)), axis.title.x = element_text(color="black", size=rel(1.6)), legend.text=element_text(color="black",size=rel(1.2)), legend.title = element_text(color="black",size=rel(1.6)) # legend.position=c(0,1),legend.justification=c(-1,0) # legend.position="top", ) dev.off() rm(list=ls()) library(ggplot2) library(Cairo) setwd("D:/R_for_lm/LM_Shengxinwenzhangzhuanxie/52MRNA_KEGGandGO") GO_MF<-read.table("GO_MF_pxiaoyu0.05.csv",header=TRUE,sep=",") png_path="./figure/GO_MF.png" CairoPNG(filename="png_path.png", width=14000,height=6000,dpi=1000) ggplot(data=GO_MF)+ geom_bar(aes(x=reorder(Term,Count),y=Count, fill=-log10(PValue)), stat='identity') + coord_flip() + scale_fill_gradient(expression(-log["10"](P.value)),low="blue", high = "red") + xlab("") + ylab("Gene count") + scale_y_continuous(expand=c(0, 0))+ theme( axis.text.x=element_text(color="black",size=rel(1.5)), axis.text.y=element_text(color="black", size=rel(1.5)), axis.title.x = element_text(color="black", size=rel(1.6)), legend.text=element_text(color="black",size=rel(1.2)), legend.title = element_text(color="black",size=rel(1.6)) # legend.position=c(0,1),legend.justification=c(-1,0) # legend.position="top", ) dev.off() rm(list=ls()) library(ggplot2) library(Cairo) setwd("D:/R_for_lm/LM_Shengxinwenzhangzhuanxie/52MRNA_KEGGandGO") KEGG_pathway<-read.table("KEGG_pxioayu0.05.csv",header=TRUE,sep=",") png_path="./figure/KEGG_pathway.png" CairoPNG(filename="png_path.png", width=7000,height=2300,dpi=1000) ggplot(data=KEGG_pathway)+ geom_bar(aes(x=reorder(Term,Count),y=Count, fill=-log10(PValue)), stat='identity') + coord_flip() + scale_fill_gradient(expression(-log["10"](P.value)),low="blue", high = "red") + xlab("") + ylab("Gene count") + scale_y_continuous(expand=c(0, 0))+ theme( axis.text.x=element_text(color="black",size=rel(1.5)), axis.text.y=element_text(color="black", size=rel(1.5)), axis.title.x = element_text(color="black", size=rel(1.6)), legend.text=element_text(color="black",size=rel(1.2)), legend.title = element_text(color="black",size=rel(1.6)) # legend.position=c(0,1),legend.justification=c(-1,0) # legend.position="top", ) dev.off() q()