MetBrewer

Color palette package in R inspired by works at the Metropolitan Museum of Art in New York

CC0-1.0 License

Downloads
65
Stars
1.1K

MetBrewer

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

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: My Website: here Twitter: here LinkedIn: here Email: [email protected]

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

Archambault

  • Womans Dress and Accessories, 2005, Jodi Archambault, Hunkpapa Lakota (Teton Sioux), Link
  • Colorblind-Friendly

Austria

  • Adoration of the Magi from Seven Scenes from the Life of Christ, 1390, Artists Unknown, Austrian, Link

Benedictus

  • Relais, 1930 : quinze planches donnant quarante-deux motifs dcoratifs : enluminure d'art de J. Saud : prliminaires de Y. Rambosson, 1930, Edouard Bnedictus, French, Link

Cassatt1

  • The Cup of Tea, 1880-1881, Mary Cassatt, American, Link
  • Colorblind-Friendly

Cassatt2

  • Lilacs in a Window (Vase de Lilas a la Fenetre), 188083, Mary Cassatt, American, Link
  • Colorblind-Friendly

Cross

  • Cap Ngre, 1909, Henri-Edmond Cross, French, Link

Degas

  • The Rehearsal of the Ballet Onstage, 1874, Edgar Degas, French, Link

Demuth

  • I Saw the Figure 5 in Gold, 1928, Charles Demuth, American, Link
  • Colorblind-Friendly

Derain

  • The Palace of Westminster, 19061907, Andr Derain, French, Link
  • Colorblind-Friendly

Egypt

  • The King with Isis, Tomb of Haremhab, A.D. 19101911; original ca. 13231295 B.C., Twentieth Century; original New Kingdom, Link
  • Colorblind-Friendly

Gauguin

  • A Farm in Brittany, 1874, Paul Gauguin, French, Link

Greek

  • Terracotta neck-amphora (jar), ca. 550540 B.C., Greek, Link
  • Colorblind-Friendly

Hiroshige

  • Sailing Boats Returning to Yabase, Lake Biwa, 1835, Utagawa Hiroshige, Japanese, Link
  • Colorblind-Friendly

Hokusai1

  • Poem by Gon-Chnagon Sadaie, from the series One Hundred Poems Explained by the Nurse (Hyakunin isshu uba ga etoki), 17601849, Katsushika Hokusai, Japanese, Link

Hokusai2

  • Lake Suwa in Shinano Province (Shinsh Suwako), from the series Thirty-six Views of Mount Fuji (Fugaku sanjrokkei), 1830-32, Katsushika Hokusai, Japanese, Link
  • Colorblind-Friendly

Hokusai3

  • Yr Waterfall in Mino Province (Mino no Yr no taki), from the series A Tour of Waterfalls in Various Provinces (Shokoku taki meguri), 1832, Katsushika Hokusai, Japanese, Link
  • Colorblind-Friendly

Homer1

  • The Veteran in a New Field, 1865, Winslow Homer, American, Link

Homer2

  • Flower Garden and Bungalow, Bermuda, 1899, Winslow Homer, American, Link

Ingres

  • Josphine-lonore-Marie-Pauline de Galard de Brassac de Barn (18251860), Princesse de Broglie, 185153, Jean Auguste Dominique Ingres, French, Link
  • Colorblind-Friendly

Isfahan1

  • Mihrab (Prayer Niche), dated A.H. 755/ A.D. 135455, From Iran, Isfahan, Link
  • Colorblind-Friendly

Isfahan2

  • Garden Gathering, 164050, From Iran, Isfahan, Link
  • Colorblind-Friendly

Java

  • Skirt, 20th Century, Javanese People, Javanese, Link
  • Colorblind-Friendly

Johnson

Johnson Jitterbugs V, 194142, William Henry Johnson, American, Link

  • Colorblind-Friendly

Juarez

  • The Entombment of Christ, 1702, Juan Rodrguez Jurez, Mexican, Link

Kandinsky

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

  • Colorblind-Friendly

Klimt

  • Mda Primavesi (19032000), 1912-13, Gustav Klimt, Austrian, Link

Lakota

  • Dress, 1870, Lakota/Teton Sioux, Native American, Link

Manet

  • Boating, 1874, Edouard Manet, French, Link

Monet

  • Bridge over a Pond of Water Lilies, 1899, Claude Monet, French, Link

Moreau

  • Oedipus and the Sphinx, 1864, Gustave Moreau, French, Link

Morgenstern

  • Jungfrau, Mnch, and Eiger, 1851, Carl Morgenstern, German, Link
  • Colorblind-Friendly

Nattier

  • Madame Bergeret de Frouville as Diana, 1756, Jean Marc Nattier, French, Link

Navajo

  • Serape, 186570, Navajo, Link

NewKingdom

  • Blue-Painted Ibex Amphora from Malqata, ca. 13901353 B.C., New Kingdom, Link

Nizami

  • "Laila and Majnun in School", Folio 129 from a Khamsa (Quintet) of Nizami of Ganja, A.H. 931/A.D. 152425, Nizami, Made in present-day Afghanistan, Herat, Link

OKeeffe1

  • From the Faraway, Nearby, 1937, Georgia O'Keeffe, American, Link
  • Colorblind-Friendly

OKeeffe2

  • Red and Yellow Cliffs, 1940, Georgia O'Keeffe, American, Link
  • Colorblind-Friendly

Paquin

  • Evening Dress, 1937, House of Paquin by Ana de Pombo, French House, Spanish Designer, Link

Peru1

  • Ear Ornament, Winged Runner, A.D. 400700, Moche, Peruvian, Link

Peru2

  • Tunic with Confronting Catfish, A.D. 800850, Nasca-Wari, Peruvian, Link

Pillement

  • A Shipwreck in a Storm, 1782, Jean Pillement, French, Link
  • Colorblind-Friendly

Pissaro

  • Washerwoman, Study, 1880, Camille Pissarro, French, Link

Redon

  • Pandora, 1914, Odilon Redon, French, Link

Renoir

  • Nini in the Garden (Nini Lopez), 1876, Auguste Renoir, French, Link

Signac

  • Notre-Dame-de-la-Garde (La Bonne-Mre), Marseilles, 1905-06, Paul Signac, French, Link

Tam

  • Dragon Robe, 1998, Vivienne Tam, American, born China, Link
  • Colorblind-Friendly

Tara

  • Maharana Sarup Singh Inspects a Prize Stallion, 184546, Tara, Western India, Rajasthan, Mewar, Link

Thomas

  • Formes et couleurs: vingt planches en couleurs contenant soixante-sept motifs decoratifs, 1921, Auguste H. Thomas, French, Link

Tiepolo

  • The Glorification of the Barbaro Family, 1750, Giovanni Battista Tiepolo, Italian, Link

Troy

  • The Declaration of Love, 1724, Jean Franois de Troy, French, Link
  • Colorblind-Friendly

Tsimshian

  • Headdress frontlet, 182040, Tsimshian, Native American (Canadian), Link

VanGogh1

  • Cypresses, 1889, Vincent van Gogh, Dutch, Link

VanGogh2

  • Self-Portrait with a Straw Hat (obverse: The Potato Peeler), 1887, Vincent van Gogh, Dutch, Link

VanGogh3

  • First Steps, after Millet, 1890, Vincent van Gogh, Dutch, Link
  • Colorblind-Friendly

Veronese

  • Mars and Venus United by Love, 1570s, Paolo Veronese, Italian, Link
  • Colorblind-Friendly

Wissing

  • Portrait of a Woman, 1687, Willem Wissing, Dutch, Link

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")
Python
met_brew(name="Manet", n=5)

R
met.brewer("Manet", 5)
Python
met_brew("Morgenstern")

R
met.brewer("Morgenstern")
Python
met_brew("Troy", n=15, brew_type="continuous")

R
met.brewer("Troy", n=15, type="continuous")
Python
met_brew("Hokusai1", n=100, brew_type="continuous")

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

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))
ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width, color=Species)) +
  geom_point(size=2) +
  scale_color_manual(values=met.brewer("Renoir", 3))
ggplot(data=iris, aes(x=Species, y=Sepal.Width, color=Sepal.Width)) +
  geom_point(size=3) +
  scale_color_gradientn(colors=met.brewer("Isfahan1"))
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()

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