Color palettes for R and ggplot2 inspired by my stylish friend and colleague, Jerzy Eisenberg-Guyot. Jerzy is many things to many people, but he is a paragon of style to just about everyone. This package is a way to bring Jerzy's style to the masses.
This package was a convenient excuse to learn how to build packages in R and host them on Github (and eventually CRAN). And also an opportunity to work with my wife, Tanya Basmadjian Avoundjian, who is a very talented graphic designer (who is always supplying me with awesome color palettes for visualizations!).
To install, run the following in R:
devtools::install_github("tavoundjian/jerzpals")
The functions scale_fill_jerzeg
and scale_color_jerzeg
can be used directly with ggplot2.
jerz_pal
. If -1, the order of colors is reversed.FALSE
- generate continuous palette)library(jerzpals)
library(ggplot2)
# library(jerzpals)
data(iris)
# Discrete scale
ggplot(data = iris, aes(x = Species, y = Petal.Length)) +
geom_bar(aes(fill = Species), stat = "identity") +
scale_fill_jerzeg(option = "jerzshoe2", discrete = T) +
theme_bw()
# Continuous scale
ggplot(data = iris, aes(x = Petal.Width, y = Petal.Length)) +
geom_point(aes(color = Sepal.Width)) +
scale_color_jerzeg(option = "H", begin = 0, end = 0.5) + # use begin and end to set range of colors used in the palette
theme_bw()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.