项目作者: ewenme

项目描述 :
Studio Ghibli colour palettes
高级语言: R
项目地址: git://github.com/ewenme/ghibli.git
创建时间: 2017-08-03T17:51:26Z
项目社区:https://github.com/ewenme/ghibli

开源协议:Other

下载


" class="reference-link">ghibli

lifecycle
CRAN
status
DLs
R-CMD-check

Overview

“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 plots 。◕‿‿◕。

Installation

Install the latest stable version on CRAN…

  1. install.packages('ghibli')

…or get the development version from GitHub.

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

Palettes

ghibli provides 9 unique palettes, with a light, medium and dark
variant for each.

  1. # load package
  2. library(ghibli)
  3. # display palettes w/ names
  4. par(mfrow=c(9,3))
  5. for(i in names(ghibli_palettes)) print(ghibli_palette(i))

N.B. the palettes are exposed in YAML
format

for easier porting to new libraries.

All colour palettes are stored as color objects (courtesy of the
prismatic
package) inside ghibli_palettes with extremely cute printing (if
crayon is installed) and plotting
methods to help you preview flavours.

In the wild

ghibli provides relevant scales for use with ggplot2. It only
suggests ggplot2 in order to stay lightweight, but if available you
can use the scale_[colour|fill]_ghibli_[c|d]() functions:

  1. library(ggplot2)
  2. # ggplot stuff
  3. ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
  4. geom_jitter(size = 3) +
  5. theme_minimal() +
  6. # ghibli stuff
  7. scale_colour_ghibli_d("LaputaMedium", direction = -1)

Other stuff