【问题标题】:Change mean symbol in boxplot from dot to square (or any other shape) ggboxplot将箱线图中的平均符号从点更改为正方形(或任何其他形状)ggboxplot
【发布时间】:2022-01-06 15:39:38
【问题描述】:

目前,我使用带有 ggpubr 的 ggboxplot 将平均值表示为箱线图中的一个点。有没有办法将符号更改为正方形(或不同的符号)?由于我也用点表示抖动,我希望它不会让读者感到困惑。感谢您的帮助!

【问题讨论】:

    标签: r ggpubr


    【解决方案1】:

    尝试在this question 的答案中使用stat_summary()

    library(ggpubr)
    
    data(iris)
    
    ggboxplot(iris, x = "Species", y = "Sepal.Length", add = "jitter") +
      stat_summary(fun = mean, geom = "point", shape = 15, size = 3, color = "red")
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-04-09
      • 1970-01-01
      • 2019-07-17
      • 2023-03-29
      • 1970-01-01
      • 1970-01-01
      • 2012-09-01
      • 1970-01-01
      相关资源
      最近更新 更多