knitr::opts_chunk$set(
echo = TRUE, 
fig.align = "center",
fig.path = "figure/"
)

Project Status: Active – The project has reached a stable, usable state and is being actively developed. Build Status

Please cite this package if you use it: DOI

The colors used in this package were all found using publically available sources, many of them from LucasArts themselves. For example:

Other colors gleaned from various sources:

If you would like to contribute to the package, please submit a PR with documentation for color provenance.

Kartik Ram's Wes Anderson color palette inspired me to create this package and I followed his implementation for consistency.

Installation

devtools::install_github("butterflyology/spaceMovie")

Usage

library("spaceMovie")

Scatterplot with the "Chopper" palette

library("ggplot2")
ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
  theme_bw() +
  geom_point(size = 3) +
  scale_color_manual(values = SW_palette("Chopper")) +
  labs(y = "Sepal width", x = "Sepal length") +
  theme(legend.text = element_text(face = "italic"))

The Empire Strikes Back

SW_palette("TESB")

"Zeb"

SW_palette("Zeb")

"Sabine"

SW_palette("Sabine", n = 3)

"Boba"

SW_palette("Boba", n = 21, type = "continuous")

Stacked barplot using "Main"

qplot(factor(cyl), data = mtcars, geom = "bar", fill=factor(vs)) +
  scale_fill_manual(values = SW_palette("Main"))

A Boba Fett volcano!

SW_colors_1 <- SW_palette("Boba", 21, type = "continuous")
image(volcano, col = SW_colors_1, las = 1)

Heat map

SW_colors_2 <- SW_palette("Hera", 100, type = "continuous")

ggplot(heatmap, aes(x = X2, y = X1, fill = value)) + 
  geom_tile() + 
  scale_fill_gradientn(colours = SW_colors_2) + 
  scale_x_discrete(expand = c(0, 0)) +
  scale_y_discrete(expand = c(0, 0)) + 
  coord_equal() 


butterflyology/spaceMovie documentation built on May 13, 2019, 9:04 a.m.