apply_theme | R Documentation |
Takes in the styling options defined through visR::define_theme
and applies them to a plot.
apply_theme(gg, visR_theme_dict = NULL)
gg |
object of class |
visR_theme_dict |
nested list containing possible font options |
object of class ggplot
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.