adomingues / ghibli

Studio Ghibli colour palettes for R

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ghibli

Build Status CRAN status DLs

“No matter how many weapons you have, no matter how great your technology might be, the world cannot live without love!” —Castle in the Sky (1986)

。◕‿‿◕。 Sprinkle some Studio Ghibli palette magic over your R plots 。◕‿‿◕。

Installation

Install the latest stable version on CRAN...

install.packages('ghibli')

...or get the development version from GitHub.

# If you haven't installed remotes yet, do so
install.packages("remotes")

# install package from github
remotes::install_github("ewenme/ghibli")

Palettes

# load package
library(ghibli)

# see palette names and colours
par(mfrow=c(9,3))
for(i in names(ghibli_palettes)) print(ghibli_palette(i))

Spirited Away

ghibli_palette("SpiritedMedium")

My Neighbor Totoro

ghibli_palette("TotoroMedium")

Princess Mononoke

ghibli_palette("MononokeMedium")

When Marnie Was There

ghibli_palette("MarnieMedium1")

Ponyo

ghibli_palette("PonyoMedium")

Usage

library("ggplot2")

ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
  geom_point(size = 3) +
  scale_color_manual(values = rev(ghibli_palette("MarnieMedium1"))) +
  theme_grey()

ggplot(airquality, aes(x=Day, y=Month)) +
  geom_tile(aes(fill=Temp)) +
  scale_fill_gradientn(colours = ghibli_palette("MononokeMedium", 21, type = "continuous")) +
  scale_x_discrete(expand = c(0, 0)) +
  scale_y_discrete(expand = c(0, 0)) +
  coord_equal() +
  theme(legend.position = "top")

Credits

This package was inspired by (and lots of code ported from) Karthik Ram's wesanderson package.

The palettes mostly come from Love magazine's STUDIO GHIBLI FOREVER retrospective. Kiki's Delivery Service and My Neighbor Totoro palettes come from Movies in Color. Go check 'em.

About

Studio Ghibli colour palettes for R

License:Other


Languages

Language:R 100.0%