pr<-ggplot(sortdf,aes(GeneRatio,GO.Term,size=Count,
colour=qvalue))+#橫坐標(biāo)、縱坐標(biāo)、顏色代表p-value
geom_point()+#圓點(diǎn)的大小代表組內(nèi)基因數(shù)
scale_color_gradientn(colours=c("red","blue"))+#可以自己改顏色
#圓點(diǎn)的大小代表Number of significant genes
#scale_size_continuous(range = c(4,7))+#圓點(diǎn)的大小范圍
scale_x_continuous(limits = c(0.01,0.1))+#設(shè)置x軸范圍
theme_bw(15)+#背景變成白色
ylab("")+
scale_y_discrete(position = "right",labels=function(x) str_wrap(x, width=40))+#把term放到右側(cè),labels 用來給文本分成兩行
theme(legend.position=c(1,0),legend.justification = c(1,0))+#legend畫在左下角
#下面兩行讓legend融入圖
theme(legend.background = element_blank())+#移除legend整體的邊框
theme(legend.key = element_blank())+#移除legend每個(gè)項(xiàng)目周圍的邊框
theme(title=element_text(family="myFont",size=12,color="black",
face="plain",hjust=0.2,lineheight=0.2),
axis.title.x=element_text(size=10,face="plain",color="black",hjust=0.5),
axis.title.y=element_text(size=14,color="black",hjust=0.5,angle=45),
axis.text.x=element_text(family="myFont",size=8,color="black"),
axis.text.y.right=element_text(family="myFont",size=12,face="plain",color="black"))
##設(shè)置點(diǎn)的大小
pr+ scale_size(range=c(5, 6))
##排序點(diǎn)的位置
pr=pr+guides(size = guide_legend(order=1))
ggplot點(diǎn)的大小和文本
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。