Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increase font size of inplot mean for ggbetweenstats from ggstatsplot

Tags:

r

ggplot2

How can I increase the font size of the mean in the plot when using ggstatsplot? ggbetweenstats in particular?

I can change the font size for everything using the code below, except the mean in the actual plot.

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

enter image description here

Code to generate above plot

ggbetweenstats(
  data = iris,
  x = Species,
  y = Sepal.Length,
  title = "Distribution of sepal length across Iris species"
)
like image 346
Nosey Avatar asked Sep 03 '25 16:09

Nosey


1 Answers

You could set the font size and style the labels via 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)
)

like image 105
stefan Avatar answered Sep 05 '25 09:09

stefan