![](/img/trans.png)
[英]How to p-value with uppercase letter P to a ggplot object by using stat_cor() function?
[英]How to change the size of the p.value using “stat_cor” function?
我正在嘗試更改圖形上R2
和p.value
的大小,例如在修改stat_cor
function 時,但我在 R 中還不夠好,無法實現我的目標。 有沒有可能得到一些幫助?
非常感謝,祝您有美好的一天。 卡琳娜
sp <- ggscatter(IFNA, x = "OMsurClay_PH_s_A", y = "OMsurclay_PH_d_A",add = "reg.line",
add.params = list(color = "blue", fill = "lightgray"), conf.int = TRUE,)
# pour le r2
sp2<- sp + stat_cor( aes(label = paste(..rr.label.., ..p.label.., sep = "~`,`~")),label.x = 0.5, method = "spearman",label.sep = "\n")
sp3<- sp2 + theme(text=element_text(size=16,color="black"),axis.text=element_text(size=16,color="black"),axis.title.x = element_text(face= "bold", size= 16),axis.title.y = element_text(face= "bold", size= 16))
sp3 +labs( x ="OM_OM/Clay_pH_s_A", y = "OM_OM/Clay_pH_d_A")
stat_cor 采用其他 arguments 傳遞給 geom_text 或 geom_label,包括“大小”和“顏色”,因此您可以像這樣更改命令:
stat_cor( aes(label = paste(..rr.label.., ..p.label.., sep = "~`,`~")),label.x = 0.5, method = "spearman",label.sep = "\n", size = 10)
您可以添加 cor.coef.size =
sp <- ggscatter(IFNA, x = "OMsurClay_PH_s_A", y = "OMsurclay_PH_d_A",add = "reg.line",
add.params = list(color = "blue", fill = "lightgray"), conf.int = TRUE, cor.coef.size = 7)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.