首页 > 解决方案 > 从 ggstatsplot 增加 ggbetweenstats 的 inplot 均值的字体大小

问题描述

使用 ggstatsplot 时如何增加图中均值的字体大小?特别是ggbetweenstats?

我可以使用下面的代码更改所有内容的字体大小,实际图中的平均值除外。

  ggplot.component = list(theme(text = element_text(size = 21))))

在此处输入图像描述

生成上图的代码

ggbetweenstats(
  data = iris,
  x = Species,
  y = Sepal.Length,
  title = "Distribution of sepal length across Iris species"
)

标签: rggplot2

解决方案


您可以通过以下方式设置字体大小和标签样式centrality.label.args

library(ggstatsplot)

ggbetweenstats(
  data = iris,
  x = Species,
  y = Sepal.Length,
  title = "Distribution of sepal length across Iris species",
  centrality.label.args = list(size  = 8)
)


推荐阅读