python boxplot significance_ggplot的boxplot添加显著性 | Add P-values and Significance Levels to ggplots...

代码例子:

options(repr.plot.width=7, repr.plot.height=6)

# facet boxplot

bp

geom_boxplot(outlier.size=NA, size=0.01, outlier.shape = NA) +

geom_jitter(width = 0.3, size=0.01, aes(color=cluster)) +

# + geom_boxplot( +

facet_grid( cluster ~ gene, switch="y") + # , scales = "free"

theme_bw() +

stat_compare_means(aes(group = group, label = ..p.signif..), label.x = 1.3,label.y = 1.3,

method = "wilcox.test", hide.ns = T) + # label = "p.format",

theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank()) +

labs(x = "", y = "", title = "") +

theme(panel.spacing=unit(.3, "lines"),panel.border = element_rect(color = "black", fill = NA, size = 0.2)) +

theme(axis.ticks.x = element_blank(), axis.ticks = element_line(size = 0.1),

axis.text.x = element_text(face="plain", angle=90, size = 8, color = "black", vjust=0.5),

axis.text.y = element_text(face="plain", size = 4, color = "black"),

axis.title =element_text(size = 12)) +

theme(strip.background = element_rect(fill = "gray97", color = NA))+

theme(legend.position = "none") +

theme(strip.placement = "outside", strip.text.x = element_text(face="italic", size = 11),

strip.text.y = element_text(face="plain", size = 11)) +

scale_y_continuous(position="right", limits = c(-0.5,1.5)) +

scale_fill_manual(values=brewer.pal(8,"Set2")[c(2,3,7,1,5,6)]) +

scale_color_manual(values=brewer.pal(8,"Set2")[c(2,3,7,1,5,6)])

bp

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值