set_plot_theme: Function to set plot theme

View source: R/olink_theme.R

set_plot_themeR Documentation

Function to set plot theme

Description

This function sets a coherent plot theme for functions.

Usage

set_plot_theme(font = "Arial")

Arguments

font

Font family to use for text elements. Default: "Arial".

Value

No return value, used as theme for ggplots

Examples


if (rlang::is_installed(pkg = c("showtext", "systemfonts",
                                "sysfonts", "curl"))) {
  ggplot2::ggplot(
    data = datasets::mtcars,
    mapping = ggplot2::aes(
      x = .data[["wt"]],
      y = .data[["mpg"]],
      color = as.factor(x = .data[["cyl"]])
    )
  ) +
    ggplot2::geom_point(
      size = 4L
    ) +
    OlinkAnalyze::set_plot_theme()

  ggplot2::ggplot(
    data = datasets::mtcars,
    mapping = ggplot2::aes(
      x = .data[["wt"]],
      y = .data[["mpg"]],
     color = as.factor(x = .data[["cyl"]])
    )
  ) +
    ggplot2::geom_point(
      size = 4L
    ) +
    OlinkAnalyze::set_plot_theme(
      font = ""
    )
}


OlinkAnalyze documentation built on June 24, 2026, 1:06 a.m.