一ggplot2 | 张图画多个KEGG富集结果
2022-10-06 本文已影响0人
iBioinformatics
https://www.jianshu.com/p/40c6bd76e936
输入文件示例;Species用于指定不同的分组
library(ggplot2)
pathway = read.csv("kegg1.csv",header = TRUE,check.names = FALSE)
head(pathway)
plot<- ggplot(pathway,aes(Species,PATHWAY))+
geom_point(aes(size=Gene,color=Pvalue))+
scale_color_gradient(low = "blue",high = "red")+
#用于设置1部分字体和颜色
theme(legend.title=element_text(size=20, face="bold", color="black"),
legend.text = element_text(size=18))+
#用于设置2,即XY轴标题字体和颜色
theme(axis.title.y = element_text(size = 25, face="bold", color="black", margin = margin(r = 50)),axis.title.x = element_text(margin = margin(t = 20)))+
theme(axis.title.x = element_text(size = 25, face="bold", color="black"))+
#用于设置XY的text的字体和颜色
theme(axis.text.y = element_text(size = 14, face ="bold",color="black"))+
theme(axis.text.x = element_text(size = 14, face ="bold",color="black",angle=90,vjust=0.5,hjust=0))
ggsave(plot, filename="KEGG.pdf", width=10, height=20, dpi=100)