增加 ggbetweenstats (R) 的 inplot 均值的字体大小,但不要将其写在图上

Increase font size of inplot mean for ggbetweenstats (R) but not write it over the plots

如果您使用下面的代码来增加 inplot means 的字体大小,means 将被写在图上(参见 ). I would like to increase the font size, but still have the means next to the plots as in the picture in question in 中答案中的图片)。这可能吗?

library(ggstatsplot)

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

您可以使用 nudge_xnudge_y 参数指定标签的位置。也许你想要这样的东西:

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

输出:

请记住,由于字体太大,很难以干净的方式放置标签。如果需要,您可以手动更改参数。