Skip to content

vikjam/RColorLisa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RColorLisa

Easily load color palettes from great painters into R. Based on the work of Ryan McGuire who created the beautiful site Color Lisa.

Installation

devtools::install_github("vikjam/RColorLisa")

Usage

Examples

# Create a sequential palette for usage and show colors
library(RColorLisa)
pretty.palette <- color.lisa.pal(5, "The Dream by Pablo Picasso")
image(1:5, 1, as.matrix(1:5), col = pretty.palette, xlab = "The Dream by Pablo Picasso",
      ylab = "", xaxt = "n", yaxt = "n", bty = "n")

the-dream

# ggplot2 example
library(ggplot2)
library(RColorLisa)
df <- data.frame(x = rep(c(2, 5, 7, 9, 12), 2),
                 y = rep(c(1, 2), each = 5),
                 z = factor(rep(1:5, each = 2)))
escher.pal <- color.lisa.pal(5, "Gravity by M.C. Escher")
ggplot(df, aes(x, y)) + geom_tile(aes(fill = z)) +
                        scale_fill_manual(values = escher.pal)

escher-tile

# Slightly more practical ggplot2 example
library(ggplot2)
library(RColorLisa)
ernst.pal <- color.lisa.pal(3, "Woman, Old Man, and Flower by Max Ernst")
ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) + 
       geom_point(size = 3) + 
       scale_color_manual(values = ernst.pal)

iris-ernst

# A gradient
library(ggplot2)
library(RColorLisa)
rothko.pal <- color.lisa.pal(5, "Untitled (Orange, Yellow, Red) by Mark Rothko")
ggplot(faithfuld, aes(waiting, eruptions)) +
       geom_raster(aes(fill = density), interpolate = TRUE) +
       scale_fill_gradientn(colours = rothko.pal)

faithful-rothko

About

Provides color palettes for R from great painters based on http://colorlisa.com/.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published