Home > Software design >  ggplot how to control fonts on boxplot with stat
ggplot how to control fonts on boxplot with stat

Time:06-10

How do I control the font-family and size for text elements added to my boxplot:

Following the approach enter image description here

CodePudding user response:

Geom/stat fonts are set in the geom/stat layer, not in theme(). In this case, you can add family = "mono" as an argument to your stat_summary().

The size of fonts in geom_text/geom_label etc. is not on the same scale as element_text theme options, which are in points. You can read more about that here and here.

  • Related