坐山雕

导航

ggplot test

 

 

 

library(ggpubr)
my_comparisons <- list( c("0.5", "1"), c("1", "2"), c("0.5", "2") )
options(repr.plot.width=4, repr.plot.height=4)
ggplot(ToothGrowth, aes(x=as.character(dose), y=len, fill=dose)) +
geom_boxplot(outlier.size=NA, size=0.01, outlier.shape = NA) +
geom_jitter(width = 0.3, size=0.01) +# , aes(color=supp) +
stat_compare_means(comparisons = my_comparisons)+ # Add pairwise comparisons p-value
stat_compare_means(label.y = 50, label.x = 1.5) # Add global p-value

posted on 2020-12-29 11:56  坐山雕  阅读(81)  评论(0)    收藏  举报