knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(architekter)
library(ggplot2) my_awesome_theme <- get_figma_file_content(file_key = "wRqIvMmymzSPuj0sEhnORb", acess_token = Sys.getenv("FIGMA_TOKEN")) %>% extract_ggplot_theme() %>% create_theme_fun() # Toy plot 1 #' \dontrun{ ggplot(data = iris) + aes(x = Sepal.Width, fill = Species) + geom_density() + labs(title = "Sepal width of several species of iris", subtitle = "This plot respects the graphic design system defined in Figma", x = "Sepal width", y = "Density", color = "Iris species") + my_awesome_theme() #' } # Toy plot 2 #' \dontrun{ ggplot(data = iris) + aes(x = Sepal.Width, fill = Species) + geom_density() + labs(title = "Sepal width of several species of iris", subtitle = "This plot respects the graphic design system defined in Figma", x = "Sepal width", y = "Density", color = "Iris species") + my_awesome_theme(legend.position = "bottom") #' } # Toy plot 3 #' \dontrun{ ggplot(data = iris) + aes(x = Sepal.Length, y = Sepal.Width, color = Species) + geom_point() + labs(title = "Relationship between sepal length and sepal width of several species of iris", subtitle = "This plot respects the graphic design system defined in Figma", x = "Sepal length", y = "Sepal width", color = "Iris species") + my_awesome_theme() #' } # Toy plot 4 #' \dontrun{ ggplot(data = iris) + aes(x = Sepal.Length, y = Sepal.Width) + geom_point() + labs(title = "Relationship between sepal length and sepal width of several species of iris", subtitle = "This plot respects the graphic design system defined in Figma", x = "Sepal length", y = "Sepal width") + facet_grid(cols = vars(Species)) + my_awesome_theme() #' }
data(toy_raw_file_content) library(ggplot2) my_theme <- toy_raw_file_content %>% extract_ggplot_theme() %>% create_theme_fun() #' \dontrun{ ggplot(data = iris) + aes(x = Sepal.Width, fill = Species) + geom_density() + labs(title = "Sepal width of several species of iris", subtitle = "This plot respects the graphic design system defined in Figma", x = "Sepal width", y = "Density", color = "Species") + my_theme() #' }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.