create_theme_fun: Create a theme functions by using the ggplot2 elements...

View source: R/create_theme_fun.R

create_theme_funR Documentation

Create a theme functions by using the ggplot2 elements extracted from the Figma file

Description

Create a theme functions by using the ggplot2 elements extracted from the Figma file

Usage

create_theme_fun(.data)

Arguments

.data

Tibble. ggplot2 elements as created by architekter::extract_ggplot_theme()

Value

A ggplot2 theme function.

Examples

data(toy_raw_file_content)

library(ggplot2)

my_theme <- toy_raw_file_content %>% 
  extract_ggplot_theme() %>% 
  create_theme_fun()

## Not run: 
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()

## End(Not run)

ThinkR-open/swatch documentation built on April 7, 2022, 6:08 p.m.