Home

Awesome

MetBrewer <img align="right" src="https://github.com/BlakeRMills/MetBrewer/blob/main/PaletteImages/Hex/MetBrewerHex.jpg" width=400>

Palettes inspired by works at the Metropolitan Museum of Art in New York. Pieces selected come from various time periods, regions, and mediums.

CRAN Version CRAN Downloads

Structure of the package was based on coding from the PNWColors and wesanderson packages. Inspired by the package RColorBrewer from the work of Cynthia Brewer.

For requests, questions, comments, concerns, or any thing else, feel free to reach out to me:<br /> My Website: here<br /> Twitter: here<br /> LinkedIn: here <br />Email: blakerobertmills@gmail.com

Content

Installation

Palettes

Functions

Colorblind Checking

Install Package

R

MetBrewer is now able to be downloaded directly through R. You can still download through GitHub as well.

install.packages("MetBrewer")

install.packages("devtools")
devtools::install_github("BlakeRMills/MetBrewer")

Python

Install the package under the Python/ directory directly:

python setup.py install

or via pip:

pip install .

or place the file into your source directory.

Use it in your code:

import met_brewer
colors = met_brew(name="VanGogh1", n=123, brew_type="continuous")

Palettes

All Palettes

AllPals

Archambault

Archambault


Austria

Austria


Benedictus

Benedictus


Cassatt1

Cassatt


Cassatt2

Cassatt2


Cross

Cross


Degas

Degas


Demuth

Demuth


Derain

Derain


Egypt

Egypt


Gauguin

Gauguin


Greek

Greek


Hiroshige

Hiroshige


Hokusai1

Hokusai


Hokusai2

Hokusai2


Hokusai3

Hokusai3


Homer1

Homer1


Homer2

Homer2


Ingres

Ingres


Isfahan1

Isfahan1


Isfahan2

Isfahan2


Java

Java


Johnson

Johnson Jitterbugs V, 1941–42, William Henry Johnson, American, Link


Juarez

Juarez


Kandinsky

Kandinsky Kleine Welten IV (Small Worlds IV), 1922, Vasily Kandinsky, French, born Russia, Link


Klimt

Klimt


Lakota

Lakota


Manet

Manet


Monet

Monet


Moreau

Moreau


Morgenstern

Morgenstern


Nattier

Nattier


Navajo

Navajo


NewKingdom

NewKingdom


Nizami

Nizami


OKeeffe1

OKeeffe1


OKeeffe2

OKeeffe2


Paquin

Paquin


Peru1

Peru1


Peru2

Peru2


Pillement

Pillement


Pissaro

Pissaro


Redon

Redon


Renoir

Renoir


Signac

Signac


Tam

Tam


Tara

Tara


Thomas

Thomas


Tiepolo

Tiepolo


Troy

Troy


Tsimshian

Tsimshian


VanGogh1

VanGogh1


VanGogh2

VanGogh2


VanGogh3

VanGogh3


Veronese

Veronese


Wissing

Wissing

Functions

You can retrieve palettes using various methods listed below.

Python
met_brew(name="VanGogh1", n=7, brew_type="discrete")

R
met.brewer(name="VanGogh1", n=7, type="discrete")

Ex1

Python
met_brew(name="Manet", n=5)

R
met.brewer("Manet", 5)

Ex2

Python
met_brew("Morgenstern")

R
met.brewer("Morgenstern")

Ex3

Python
met_brew("Troy", n=15, brew_type="continuous")

R
met.brewer("Troy", n=15, type="continuous")

Ex4

Python
met_brew("Hokusai1", n=100, brew_type="continuous")

R
met.brewer("Hokusai1", n=100)

Ex5

ggplot2 Examples

Here are also some ways you can incorporate this package into {ggplot2}

ggplot(data=iris, aes(x=Species, y=Petal.Length, fill=Species)) +
  geom_violin() +
  scale_fill_manual(values=met.brewer("Greek", 3))

Ex6

ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width, color=Species)) +
  geom_point(size=2) +
  scale_color_manual(values=met.brewer("Renoir", 3))

Ex7

ggplot(data=iris, aes(x=Species, y=Sepal.Width, color=Sepal.Width)) +
  geom_point(size=3) +
  scale_color_gradientn(colors=met.brewer("Isfahan1"))

Ex8

library(urbnmapr)
countydata %>%
  left_join(counties, by = "county_fips") %>%
  filter(state_name =="Nebraska") %>%
  ggplot(mapping=aes(long,lat,group = group, fill = horate)) +
  geom_polygon(color="black",size=.25) +
  scale_fill_gradientn(colors = met.brewer("Morgenstern")) +
  coord_fixed() +
  labs(fill="Homeownership rate") +
  theme_void()

Ex9

Colorblind Friendly Checking

The package has been updated to check for colorblind-friendlyness You can list out the colorblind-friendly palettes with the following code

Python
for palette_name, palette_dict in COLORBLIND_PALETTES.items():
    print(palette_name)
    
[1] Cassatt1, Cassatt2, Derain, Egypt, Greek, Hiroshige, Hokusai2, Hokusai3, Ingres
[2] Isfahan1, Isfahan2, Morgenstern, OKeeffe1, OKeeffe2, Pillement, Troy, VanGogh3, Veronese

R
MetBrewer::colorblind_palettes

 [1] "Archambault" "Cassatt1"    "Cassatt2"    "Demuth"      "Derain"      "Egypt"       "Greek"       "Hiroshige"  
 [9] "Hokusai2"    "Hokusai3"    "Ingres"      "Isfahan1"    "Isfahan2"    "Java"        "Johnson"     "Kandinsky"  
[17] "Morgenstern" "OKeeffe1"    "OKeeffe2"    "Pillement"   "Tam"         "Troy"        "VanGogh3"    "Veronese"   

You can also test is a palettes is colorblind friendly using the function provided

Python
is_colorblind_friendly("Ingres")
[1] True

R
MetBrewer::colorblind.friendly("Ingres")
[1] TRUE