Number of votes polled for each episode of Power Rangers - visualzied as a tile chart
#TidyTuesday
Author
Aditya Dahiya
Published
August 31, 2024
How I made this graphic?
Loading libraries & data
Code
# Data Import and Wrangling Toolslibrary(tidyverse) # All things tidy# Final plot toolslibrary(scales) # Nice Scales for ggplot2library(fontawesome) # Icons display in ggplot2library(ggtext) # Markdown text support for ggplot2library(showtext) # Display fonts in ggplot2library(colorspace) # Lighten and Darken colourslibrary(seecolor) # To print and view colourslibrary(patchwork) # Combining plotspower_rangers_episodes <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2024/2024-08-27/power_rangers_episodes.csv')power_rangers_seasons <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2024/2024-08-27/power_rangers_seasons.csv')
# Font for titlesfont_add_google("Carter One",family ="title_font") # Font for the captionfont_add_google("M PLUS Code Latin",family ="caption_font") # Font for plot textfont_add_google("Lexend Deca",family ="body_font") showtext_auto()bg_col <-"white"text_col <-"#6F008DFF"text_hil <- text_colbts <-80# Caption stuff for the plotsysfonts::font_add(family ="Font Awesome 6 Brands",regular = here::here("docs", "Font Awesome 6 Brands-Regular-400.otf"))github <-""github_username <-"aditya-dahiya"xtwitter <-""xtwitter_username <-"@adityadahiyaias"social_caption_1 <- glue::glue("<span style='font-family:\"Font Awesome 6 Brands\";'>{github};</span> <span style='color: {text_hil}'>{github_username} </span>")social_caption_2 <- glue::glue("<span style='font-family:\"Font Awesome 6 Brands\";'>{xtwitter};</span> <span style='color: {text_hil}'>{xtwitter_username}</span>")plot_title <-"Power Rangers Frachise:\nFalling Populatiry over seasons"plot_subtitle <-str_wrap("The number of votes polled for ratings of each episode fell after the first three seasons, and never really recovered.", 42)plot_subtitle |>str_view()plot_caption <-paste0("**Data:** Kaggle's Power Rangers Dataset", " | **Code:** ", social_caption_1, " | **Graphics:** ", social_caption_2 )rm(github, github_username, xtwitter, xtwitter_username, social_caption_1, social_caption_2)
library(magick)# Saving a thumbnail for the webpageimage_read(here::here("data_vizs", "tidy_power_rangers.png")) |>image_resize(geometry ="400") |>image_write(here::here("data_vizs", "thumbnails", "tidy_power_rangers.png"))