1

Is there anyway to print total number (eg. n = xxx, either on x-axis or inside the boxplot) for each group when using ggboxplot?

zx8754
  • 52,746
  • 12
  • 114
  • 209
Jonathan
  • 41
  • 3
  • Why use *ggpubr*, try using *ggplot2* geom_boxplot, see example here: https://stackoverflow.com/questions/15660829/how-to-add-a-number-of-observations-per-group-and-use-group-mean-in-ggplot2-boxp – zx8754 Feb 26 '18 at 20:19
  • @zx8754 doesn't answer the question. There are numerous why one might want to use a secondary level library for convenience. – posdef Nov 12 '19 at 10:28
  • @posdef It is just a comment with a link (not an answer), which helps put together related posts. In case others wish to use ggplot solution instead of ggpubr. – zx8754 Nov 12 '19 at 11:17

1 Answers1

2

I figured it out by myself, should use:

ggboxplot( ) + scale_x_discrete(labels = c())
zx8754
  • 52,746
  • 12
  • 114
  • 209
Jonathan
  • 41
  • 3