Skip to contents

Adjust font

Usage

adjust_font(plot, fontsize = 7, family = NULL, face = NULL, color = "black")

Arguments

plot

A tidyplot generated with the function tidyplot().

fontsize

Font size in points. Defaults to 7.

family

Font family

face

Font face ("plain", "italic", "bold", "bold.italic")

color

A hex color for the stroke color. For example, "#FFFFFF" for white.

Value

A tidyplot object

Examples

# Plot without adjustments
study %>%
  tidyplot(x = treatment, y = score, color = treatment) %>%
  add_data_points_beeswarm() %>%
  add_mean_bar(alpha = 0.4) %>%
  add_sem_errorbar()


# Increase font size
study %>%
  tidyplot(x = treatment, y = score, color = treatment) %>%
  add_data_points_beeswarm() %>%
  add_mean_bar(alpha = 0.4) %>%
  add_sem_errorbar() %>%
  adjust_font(fontsize = 16)


# Change font family
study %>%
  tidyplot(x = treatment, y = score, color = treatment) %>%
  add_data_points_beeswarm() %>%
  add_mean_bar(alpha = 0.4) %>%
  add_sem_errorbar() %>%
  adjust_font(family = "mono")


# Change font face
study %>%
  tidyplot(x = treatment, y = score, color = treatment) %>%
  add_data_points_beeswarm() %>%
  add_mean_bar(alpha = 0.4) %>%
  add_sem_errorbar() %>%
  adjust_font(face = "bold")