Skip to content

Commit

Permalink
version 0.0.0.9100
Browse files Browse the repository at this point in the history
- update README with intro blogpost, consolidate plots into 1 image for GoT, avatar, P&R
- update news
- further changes will go to DEV branch
  • Loading branch information
Ryo-N7 committed May 18, 2019
1 parent d10fda6 commit c85728e
Show file tree
Hide file tree
Showing 12 changed files with 197 additions and 236 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
^LICENSE\.md$
^.*\.Rproj$
^\.Rproj\.user$
^notes-todos\.txt$
6 changes: 4 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: tvthemes
Title: TV show themes and color palettes for ggplot2 graphics
Version: 0.0.0.9000
Version: 0.0.0.9100
Authors@R:
person(given = "Ryo",
family = "Nakagawara",
Expand All @@ -26,7 +26,9 @@ Suggests:
emo (>= 0.0.0.9000),
glue (>= 1.3.1),
dplyr (>= 0.8.0.1),
spelling
spelling (>= 2.0),
cowplot (>= 0.9.4),
patchwork (>= 0.0.1)
URL: https://github.com/Ryo-N7/tvthemes
BugReports: https://github.com/Ryo-N7/tvthemes/issues
Language: en-US
13 changes: 13 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# tvthemes 0.0.0.9100

* Corrected `title` in P&R, R&M, TLA themes to `plot.title`
* Fix swapped `axis.title.size` and `axis.text.size` in R&M theme
* Tests added for ALL defaults in `theme_*()` to prevent above bugs

# tvthemes 0.0.0.9000

* Initial release of package.
* __Avatar: The Last Airbender__: theme + palettes (Fire Nation, Water Tribe, Earth Kingdom, & Air Nomads)
* __Brooklyn Nine-Nine__: theme + palettes (regular & dark)
* __Game of Thrones/A Song of Ice & Fire__: 'The Palettes of Ice & Fire' (currently: Stark, Lannister, Tully, Targaryen, Greyjoy, & Tyrell)
* __Rick & Morty__: theme + palette
* __Parks & Recreation__: two themes (light & dark) + palette
* __The Simpsons__: theme + palette
* __Spongebob Squarepants__: theme + palette + background images
190 changes: 87 additions & 103 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ knitr::opts_chunk$set(

[Ryo Nakagawara | Twitter: `@R_by_Ryo`](https://twitter.com/R_by_Ryo)

The `tvthemes` package is a collection of various `ggplot2` themes and color/fill palettes based on everybody's favorite TV shows. What kick-started this whole package was my [blogpost](https://ryo-n7.github.io/2019-02-15-visualize-brooklyn-nine-nine/) looking at simple TV stats on my current favorite TV show, Brooklyn Nine-Nine. I got a lot of good feedback on the colors I used for the custom `ggplot2` theme and color palettes so I decided to expand it to other shows that I love! Suggestions and Pull Requests for palettes/themes are welcome!
The `tvthemes` package is a collection of various `ggplot2` themes and color/fill palettes based on everybody's favorite TV shows. What kick-started this whole package was my [blogpost](https://ryo-n7.github.io/2019-02-15-visualize-brooklyn-nine-nine/) looking at simple TV stats on my current favorite TV show, Brooklyn Nine-Nine. I got a lot of good feedback on the colors I used for the custom `ggplot2` theme and color palettes so I decided to expand it to other shows that I love! You can also learn about `tvthemes` from the introductory blog post on my website, [here](https://ryo-n7.github.io/2019-05-16-introducing-tvthemes-package/).

Suggestions and Pull Requests for palettes/themes are welcome!

```{r, echo=FALSE, message=FALSE}
# pacman::p_load(ggplot2, dplyr, tvthemes, extrafont)
Expand All @@ -36,6 +38,8 @@ library(dplyr)
library(glue)
library(gapminder)
library(emo)
library(patchwork)
library(cowplot)
library(extrafont)
loadfonts()
```
Expand Down Expand Up @@ -153,9 +157,9 @@ paintBikiniBottom(plot = bobspog_plot,
background = "background")
```

### Game of Thrones: House Stark
### Game of Thrones: House Stark, Lannister, Targaryen

```{r}
```{r, fig.width=15, fig.height = 10, message=FALSE}
mpg %>%
ggplot(aes(displ)) +
geom_histogram(aes(fill = class), col = "black", size = 0.1) +
Expand All @@ -166,66 +170,21 @@ mpg %>%
scale_x_continuous(expand = c(0,0)) +
scale_fill_stark() +
theme_minimal() +
theme(text = element_text(family = "Cinzel", size = 14))
```

### The Simpsons

```{r}
data <- gapminder::gapminder %>%
filter(country %in% c("France", "Germany", "Ireland", "Italy", "Japan", "Norway", "Belarus")) %>%
mutate(year = as.Date(paste(year, "-01-01", sep = "", format='%Y-%b-%d')))
ggplot(data = data, aes(x = year, y = gdpPercap, fill = country)) +
geom_area(alpha = 0.8) +
scale_x_date(breaks = data$year, date_labels = "%Y") +
scale_y_continuous(expand = c(0, 0), labels = scales::dollar) +
scale_fill_simpsons() +
labs(title = "The Simpsons",
subtitle = "Theme inspired in part by @nathancunn's blog posts",
caption = glue::glue("
A 'Bake 'em Away, Toys!' Production
Location: Sector 7G"),
x = "Wel-diddly-elcome neighborino!",
y = "Price of Duff Beer") +
theme_simpsons(title.font = "Akbar",
text.font = "Akbar",
axis.text.size = 8)
```

### Rick and Morty

```{r}
ggplot(diamonds, aes(price, fill = cut)) +
geom_histogram(binwidth = 500) +
scale_fill_rickAndMorty() +
labs(title = "Dammit Morty, You Know Diamonds Aren't Forever Right?",
subtitle = "They're blood diamonds, Morty **burp**",
caption = "Wubbalubbadubdub!") +
theme_rickAndMorty(title.font = "Get Schwifty",
text.font = "Get Schwifty",
title.size = 14)
```

### Game of Thrones: House Lannister
theme(text = element_text(family = "Cinzel", size = 14)) -> stark
```{r}
cols <- lannister_pal()(5)
colstully <- tully_pal()(5)
ggplot(diamonds, aes(price, fill = cut)) +
geom_histogram(binwidth = 500) +
labs(title = "You are done with whores.",
subtitle = "The next one I find in your bed, I'll hang.",
caption = "Rains of Castamere") +
scale_fill_manual(values = rev(cols)) +
#scale_fill_lannister() +
scale_fill_manual(values = rev(colstully)) +
#scale_fill_tully() +
labs(title = "I've seen wet shits I like better than Walder Frey.",
subtitle = "Pardon my lord, my lady. I need to find a tree to piss on.",
caption = "- The Blackfish") +
theme_minimal() +
theme(text = element_text(family = "Cinzel", size = 14))
```

### Game of Thrones: House Targaryen
theme(text = element_text(family = "Cinzel", size = 10),
title = element_text(family = "Cinzel", size = 14)) -> tully
```{r}
ggplot(gapminder::gapminder, aes(x = log10(gdpPercap), y = lifeExp)) +
geom_point(aes(color = continent)) +
scale_x_log10() +
Expand All @@ -235,15 +194,18 @@ ggplot(gapminder::gapminder, aes(x = log10(gdpPercap), y = lifeExp)) +
caption = "- Fire & Blood.") +
theme_minimal() +
theme(text = element_text(family = "Cinzel", size = 10),
title = element_text(family = "Cinzel", size = 14))
title = element_text(family = "Cinzel", size = 14)) -> targaryen
## patchwork together:
stark + tully - targaryen + plot_layout(ncol = 1)
```

### Game of Thrones: House Tyrell
### Game of Thrones: House Tyrell, Tully, Greyjoy

```{r}
```{r, fig.width=15, fig.height = 10}
data <- gapminder::gapminder %>%
filter(country %in% c("France", "Germany", "Ireland", "Italy", "Japan", "Norway", "Belarus")) %>%
mutate(year = as.Date(paste(year, "-01-01", sep = "", format='%Y-%b-%d')))
mutate(year = as.Date(paste(year, "-01-01", sep = "", format = '%Y-%b-%d')))
ggplot(data = data, aes(x = year, y = gdpPercap, fill = country)) +
geom_area(alpha = 0.8) +
Expand All @@ -256,29 +218,20 @@ ggplot(data = data, aes(x = year, y = gdpPercap, fill = country)) +
theme_minimal() +
theme(text = element_text(family = "Cinzel", size = 10),
plot.title = element_text(family = "Cinzel", size = 16),
plot.subtitle = element_text(family = "Cinzel", size = 12))
```

### Game of Thrones: House Tully
plot.subtitle = element_text(family = "Cinzel", size = 12)) -> tyrell
```{r}
cols <- tully_pal()(5)
cols <- lannister_pal()(5)
ggplot(diamonds, aes(price, fill = cut)) +
geom_histogram(binwidth = 500) +
labs(title = "You are done with whores.",
subtitle = "The next one I find in your bed, I'll hang.",
caption = "Rains of Castamere") +
scale_fill_manual(values = rev(cols)) +
#scale_fill_tully() +
labs(title = "I've seen wet shits I like better than Walder Frey.",
subtitle = "Pardon my lord, my lady. I need to find a tree to piss on.",
caption = "- The Blackfish") +
#scale_fill_lannister() +
theme_minimal() +
theme(text = element_text(family = "Cinzel", size = 10),
title = element_text(family = "Cinzel", size = 14))
```
theme(text = element_text(family = "Cinzel", size = 14)) -> lannister
### Game of Thrones: House Greyjoy

```{r}
airquality %>%
mutate(Month = as.factor(Month)) %>%
ggplot(aes(x = Day, y = Temp, group = Month, color = Month)) +
Expand All @@ -289,12 +242,53 @@ airquality %>%
caption = "- Euron 'The Crow's Eye' Greyjoy") +
theme_minimal() +
theme(text = element_text(family = "Cinzel", size = 10),
title = element_text(family = "Cinzel", size = 14))
title = element_text(family = "Cinzel", size = 14)) -> greyjoy
## patchwork together:
tyrell + lannister - greyjoy + plot_layout(ncol = 1)
```

### The Simpsons

```{r}
data <- gapminder::gapminder %>%
filter(country %in% c("France", "Germany", "Ireland", "Italy", "Japan", "Norway", "Belarus")) %>%
mutate(year = as.Date(paste(year, "-01-01", sep = "", format='%Y-%b-%d')))
ggplot(data = data, aes(x = year, y = gdpPercap, fill = country)) +
geom_area(alpha = 0.8) +
scale_x_date(breaks = data$year, date_labels = "%Y") +
scale_y_continuous(expand = c(0, 0), labels = scales::dollar) +
scale_fill_simpsons() +
labs(title = "The Simpsons",
subtitle = "Theme inspired in part by @nathancunn's blog posts",
caption = glue::glue("
A 'Bake 'em Away, Toys!' Production
Location: Sector 7G"),
x = "Wel-diddly-elcome neighborino!",
y = "Price of Duff Beer") +
theme_simpsons(title.font = "Akbar",
text.font = "Akbar",
axis.text.size = 8)
```

### Avatar: Fire Nation
### Rick and Morty

```{r}
ggplot(diamonds, aes(price, fill = cut)) +
geom_histogram(binwidth = 500) +
scale_fill_rickAndMorty() +
labs(title = "Dammit Morty, You Know Diamonds Aren't Forever Right?",
subtitle = "They're blood diamonds, Morty **burp**",
caption = "Wubbalubbadubdub!") +
theme_rickAndMorty(title.font = "Get Schwifty",
text.font = "Get Schwifty",
title.size = 14)
```

### Avatar: The Last Airbender (Fire Nation, Air Nomads, Water Tribe, Earth Kingdom)

```{r, fig.width=15, fig.height = 10, message=FALSE}
mpg %>%
ggplot(aes(displ)) +
geom_histogram(aes(fill = class), col = "black", size = 0.1) +
Expand All @@ -304,12 +298,8 @@ mpg %>%
x = "Lion Vultures Owned",
y = "Agni Kai Participation") +
theme_theLastAirbender(title.font = "Slayer",
text.font = "Slayer")
```

### Avatar: Air Nomads
text.font = "Slayer") -> firenation
```{r}
airquality %>%
mutate(Month = as.factor(Month)) %>%
ggplot(aes(x = Day, y = Temp, group = Month, color = Month)) +
Expand All @@ -319,12 +309,8 @@ airquality %>%
subtitle = "Appa, Yip Yip!") +
theme_theLastAirbender(title.font = "Slayer",
text.font = "Slayer",
title.size = 10)
```
title.size = 10) -> airnomads
### Avatar: Water Tribe

```{r}
ggplot(gapminder::gapminder, aes(x = log10(gdpPercap), y = lifeExp)) +
geom_point(aes(color = continent)) +
scale_x_log10() +
Expand All @@ -336,12 +322,8 @@ ggplot(gapminder::gapminder, aes(x = log10(gdpPercap), y = lifeExp)) +
theme_theLastAirbender(title.font = "Slayer",
text.font = "Slayer",
title.size = 8,
subtitle.size = 8)
```

### Avatar: Earth Kingdom
subtitle.size = 8) -> watertribe
```{r}
mpg %>%
ggplot(aes(displ)) +
geom_histogram(aes(fill = class), col = "black", size = 0.1) +
Expand All @@ -350,28 +332,27 @@ mpg %>%
subtitle = "(Welcome to Lake Laogai)") +
theme_theLastAirbender(title.font = "Slayer",
text.font = "Slayer",
title.size = 14)
title.size = 14) -> earthkingdom
## plot together:
plot_grid(firenation, airnomads, watertribe, earthkingdom, ncol = 2)
```

### Parks and Recreation

- Regular
```{r}
```{r, fig.width=10, fig.height = 6, message=FALSE}
airquality %>%
mutate(Month = as.factor(Month)) %>%
ggplot(aes(x = Day, y = Temp, group = Month, color = Month)) +
geom_point(size = 2) +
geom_point(size = 2.5) +
labs(title = "Calzones are pointless.", subtitle = "They're just pizza that's harder to eat!",
caption = "No one likes them. Good day, sir.") +
scale_color_parksAndRec() +
theme_minimal() +
theme_parksAndRec(text.font = "Titillium Web",
title.font = "Titillium Web Black",
legend.font = "Titillium Web")
```
legend.font = "Titillium Web") -> parksandrec
- Light
```{r}
mpg %>%
ggplot(aes(displ)) +
geom_histogram(aes(fill = class), col = "black", size = 0.1) +
Expand All @@ -381,7 +362,10 @@ mpg %>%
scale_fill_parksAndRec() +
theme_minimal() +
theme_parksAndRec_light(title.font = "Titillium Web Black",
text.font = "Titillium Web")
text.font = "Titillium Web") -> parksandreclight
## plot together:
plot_grid(parksandrec, parksandreclight, ncol = 2)
```

## Contributing
Expand Down
Loading

0 comments on commit c85728e

Please sign in to comment.