li ranran
li ranran

Reputation: 1

how to increase the font size of "lable and sample size plot when using ggbarstats in R

enter image description here now I am struggling to change the font size of (sample size (n=193)) and percentage 74% these kinds of texts in the picture.

Anyone could help me, thanks in advacne

I tried many ways, none of them working

Upvotes: 0

Views: 115

Answers (1)

stefan
stefan

Reputation: 125672

You can set the font size for the labels and the sample size using the arguments label.args and sample.size.label.args.

Using the default example from ggstatsplot::ggbarstats:

library(ggstatsplot)

ggbarstats(
  mtcars,
  x = vs, y = cyl,
  label.args = list(size = 6, fill = "white"),
  sample.size.label.args = list(size = 6)
)

Upvotes: 1

Related Questions