ThemePark: popular culture ggplot themes

January 10, 2024 · View on GitHub

Theme Park is a package for fun ggplot themes related to popular culture (movies, TV shows, video-games, etc.). I don’t have much time to expand this further so please consider submitting a theme!

Submit a Theme

Please help grow this package by submitting your own custom ggplot theme for a movie, show, or videogame. To submit, edit the theme_template.R script file or run ThemePark:::new_theme_park_theme() and send the edited script to matthew.jane@uconn.edu or submit a pull request. I will review it and add it or respond with suggested edits. Have fun with it!

Themes contributed

NameThemeCreator(s)
Barbietheme_barbie()Matthew B. Jané
Oppenheimertheme_oppenheimer()Matthew B. Jané & Toki Liam
Star Warstheme_starwars()Matthew B. Jané
Zeldatheme_zelda()Alex Slavenko
Terminatortheme_terminator()Alex Slavenko
Spidermantheme_spiderman()Velu P.K. Immonen
Avatartheme_avatar()Velu P.K. Immonen
Gryffindortheme_gryffindor()Begum Ozemek
Hufflepufftheme_hufflepuff()Begum Ozemek
Ravenclawtheme_ravenclaw()Begum Ozemek
Slytherintheme_slytherin()Begum Ozemek
Futuramatheme_futurama()Tylor J. Harlow
Simpsonstheme_simpsons()Tylor J. Harlow
Lord of the Ringstheme_lordoftherings()Ethan Milne
Game of Thronestheme_gameofthrones()Brennan Antone
Godfathertheme_godfather()Francisco Garre-Frutos
Finding Nemotheme_nemo()Christopher T. Kenny
Friendstheme_friends()Alexis van STRAATEN
Alientheme_alien()Luke Pilling
Grand Budapest Hoteltheme_grand_budapest()Katya Kustova
Asteroid Citytheme_asteroid_city()Katya Kustova
French Dispatchtheme_french_dispatch()Katya Kustova
Moonrise Kingdomtheme_moonrise_kingdom()Katya Kustova
Elftheme_elf()Christopher T. Kenny

Installation

You can install the development version of ThemePark from GitHub with:

# install.packages("remotes")
remotes::install_github("MatthewBJane/ThemePark")

Example

There are many theme options, listed above. You can see the list within your R session using:

library(ThemePark)
head(themepark_themes)
#>         theme                     creator
#> 1      barbie             Matthew B. Jané
#> 2 oppenheimer Matthew B. Jané & Toki Liam
#> 3    starwars             Matthew B. Jané
#> 4       zelda               Alex Slavenko
#> 5  terminator               Alex Slavenko
#> 6   spiderman           Velu P.K. Immonen

The Barbie theme (theme_barbie()) has been one of the most popular themes from ThemePark. Use it with the included dataset barbie_box_office like below:

library(ggplot2)

# see suggested colours in the palette
barbie_theme_colors
#>        text       panel      border     lighter       light      medium 
#> "#a62675ff" "#fdf6faff" "#d74ea2ff" "#f5d1e6ff" "#eeb4d7ff" "#d74ea2ff" 
#>        dark 
#> "#bf2986ff"

# plot Box Office Takings (in million USD) over Days Since Release
ggplot(barbie_box_office |> dplyr::mutate(daily=daily/1000000), 
       aes(x = day, y = daily)) +
    geom_smooth(method = 'loess', 
                color  = barbie_theme_colors["dark"],
                fill   = barbie_theme_colors["light"]) +
    geom_point(color = barbie_theme_colors["medium"]) +
    labs(title = "Barbie Scatter Plot",
         subtitle = "Daily box office takings",
         caption  = "Source: www.boxofficemojo.com",
         x = "Days since release",
         y = "Box office takings (million USD)") +
    theme_barbie()
#> `geom_smooth()` using formula = 'y ~ x'

Below is an example of using the Game of Thrones theme.

# see suggested colours in the palette
gameofthrones_theme_colors
#> background       text      panel     border    lighter      light     medium 
#>  "#1f0700"  "#D7B257"  "#F2F3B8"  "#BD6D33"  "#F2F3B8"  "#DFCB69"  "#BD6D33" 
#>       dark 
#>  "#8C4522"

`X variable` <- rnorm(50, 0, 1)
`Y variable` <- rnorm(50, 0, 1)

ggplot(data = NULL, aes(x = `X variable`, y = `Y variable`)) +
  theme_gameofthrones(gameofthrones_font = TRUE) +
  geom_smooth(method = "lm",
              color = gameofthrones_theme_colors["dark"],
              fill = gameofthrones_theme_colors["light"]) +
  geom_point(color = gameofthrones_theme_colors["medium"]) +
  ggtitle("Game of Thrones Scatter Plot")
#> `geom_smooth()` using formula = 'y ~ x'

We can mix this with colors from the Barbie theme.

g <- ggplot(mpg, aes(cty))
g + geom_density(fill = barbie_theme_colors["medium"]) +
    labs(
        title = "Density plot",
        subtitle = "City Mileage",
        caption = "Source: mpg",
        x = "City Mileage"
    ) +
    theme_gameofthrones()
ggplot(data = NULL, aes(x = `X variable`, y = `Y variable`)) +
  theme_avatar(avatar_font = TRUE) +
  geom_smooth(method = "lm", color = avatar_theme_colors["dark"], fill = avatar_theme_colors["light"]) +
  geom_point(color = avatar_theme_colors["medium"]) +
  ggtitle("Avatar Scatter Plot")
#> `geom_smooth()` using formula = 'y ~ x'
ggplot(data.frame(x = rnorm(100), y = rnorm(100)), aes(x, y)) +
  geom_smooth(method = "lm", color = godfather_theme_colors["dark"], fill = godfather_theme_colors["light"]) +
  geom_point(color = godfather_theme_colors["medium"]) +
  labs(title = "The Godfather theme", x = "Variable x", y = "Variable y") +
  theme_godfather(godfather_font = TRUE)
#> `geom_smooth()` using formula = 'y ~ x'

Citation

BibTeX:

@software{JaneBarbie2023,
  author = {Jané, Matthew B. and Pilling, Luke C. and Kenny, Christopher T.},
  month = {6},
  title = {ThemePark: popular culture ggplot themes},
  url = {https://github.com/MatthewBJane/ThemePark},
  version = {0.0.1},
  year = {2023}
}

APA:

Jané, M.B., Pilling, Luke C., & Kenny, Christopher T. (2023). ThemePark: popular culture ggplot themes (Version 0.0.9) [Source Code]. https://github.com/MatthewBJane/ThemePark