Skip to contents

[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