apply_theme: Applies a theme to a ggplot object.

View source: R/apply_theme.R

apply_themeR Documentation

Applies a theme to a ggplot object.

Description

[Experimental] Takes in the styling options defined through visR::define_theme and applies them to a plot.

Usage

apply_theme(gg, visR_theme_dict = NULL)

Arguments

gg

object of class ggplot

visR_theme_dict

nested list containing possible font options

Value

object of class ggplot

Examples


library(visR)

theme <- visR::define_theme(
  strata = list(
    "SEX" = list(
      "F" = "red",
      "M" = "blue"
    ),
    "TRTA" = list(
      "Placebo" = "cyan",
      "Xanomeline High Dose" = "purple",
      "Xanomeline Low Dose" = "brown"
    )
  ),
  fontsizes = list(
    "axis" = 12,
    "ticks" = 10,
    "legend_title" = 10,
    "legend_text" = 8
  ),
  fontfamily = "Helvetica",
  grid = FALSE,
  bg = "transparent",
  legend_position = "top"
)


gg <- adtte %>%
  visR::estimate_KM(strata = "SEX") %>%
  visR::visr() %>%
  visR::apply_theme(theme)
gg


visR documentation built on May 29, 2024, 11:50 a.m.