Package 'MetBrewer'

Title: Color Palettes Inspired by Works at the Metropolitan Museum of Art
Description: Palettes Inspired by Works at the Metropolitan Museum of Art in New York. Currently contains over 50 color schemes and checks for colorblind-friendliness of palettes. Colorblind accessibility checked using the '{colorblindcheck} package by Jakub Nowosad'<https://jakubnowosad.com/colorblindcheck/>.
Authors: Blake Robert Mills
Maintainer: Blake Robert Mills <[email protected]>
License: CC0
Version: 0.2.0
Built: 2024-08-31 06:43:02 UTC
Source: CRAN

Help Index


Names of colorblind-friendly palettes

Description

Lists all palettes that are colorblind-friendly in the package. To be colorblind-friendly, all colors in the palettes must be distinguishable with deuteranopia, protanopia, and tritanopia. Use met.brewer to construct palettes or colorblind.friendly to test for colorblind-friendliness.

Usage

colorblind_palettes

Format

An object of class character of length 24.


Colorblind-Friendly Palette Check

Description

Checks whether a palette is colorblind-friendly. Colorblind-friendliness tested using the 'colorblindcheck' package. To be colorblind-friendly, all colors in the palettes must be distinguishable with deuteranopia, protanopia, and tritanopia.

Usage

colorblind.friendly(palette_name)

Arguments

palette_name

Name of Palette. Choices are: Archambault, Austria, Benedictus, Cassatt1, Cassatt2, Cross, Degas, Demuth, Derain, Egypt, Gauguin, Greek, Hiroshige, Hokusai1, Hokusai2, Hokusai3, Homer1, Homer2, Ingres, Isfahan1, Isfahan2, Java, Johnson,Juarez, Kandinsky, Klimt, Lakota, Manet, Monet, Moreau, Morgenstern, Nattier, Navajo, NewKingdom, Nizami, OKeeffe1, OKeeffe2, Paquin, Peru1, Peru2, Pillement, Pissaro, Redon, Renoir, Signac, Tam, Tara, Thomas, Tiepolo, Troy, Tsimshian, VanGogh1, VanGogh2, VanGogh3, Veronese, and Wissing

Value

TRUE/FALSE value whether palette is colorblind-friendly

Examples

colorblind.friendly("Veronese")

View all Palettes available

Description

Function for viewing all palettes available in MetBrewer.

Usage

display_all(
  n,
  sequential = FALSE,
  colorblind_only = FALSE,
  direction = 1,
  override.order = FALSE
)

Arguments

n

Number of requested colors. If n is left blank, default palette is returned.

sequential

Should palettes displayed all at once, or one at a time. Default is all at once (FALSE).

colorblind_only

Should only colorblind friendly palettes be returned? Default is set to FALSE.

direction

Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed

override.order

Colors are picked from palette to maximize readability and aesthetics. This means that colors are not always selected in sequential order from the full palette. If override.order is set to TRUE, colors are selected in sequential order from the full palette instead. Default is FALSE.

Examples

# All Palettes
display_all(sequential = FALSE, colorblind_only = FALSE)

# All Colorblind Palettes
display_all(sequential = FALSE, colorblind_only = TRUE)

# 5 Colors of all Palettes
display_all(5, sequential = FALSE, colorblind_only = FALSE)

Met Palette Generator

Description

Color palettes inspired by works at The Metropolitan Museum of Art. Complete list of palette colors and the works that inspired them can be found on Github. Use colorblind.friendly to check whether palettes are colorblind-friendly.

Usage

met.brewer(
  name,
  n,
  type = c("discrete", "continuous"),
  direction = c(1, -1),
  override.order = FALSE
)

Arguments

name

Name of Palette. Choices are: Archambault, Austria, Benedictus, Cassatt1, Cassatt2, Cross, Degas, Demuth, Derain, Egypt, Gauguin, Greek, Hiroshige, Hokusai1, Hokusai2, Hokusai3, Homer1, Homer2, Ingres, Isfahan1, Isfahan2, Java, Johnson,Juarez, Kandinsky, Klimt, Lakota, Manet, Monet, Moreau, Morgenstern, Nattier, Navajo, NewKingdom, Nizami, OKeeffe1, OKeeffe2, Paquin, Peru1, Peru2, Pillement, Pissaro, Redon, Renoir, Signac, Tam, Tara, Thomas, Tiepolo, Troy, Tsimshian, VanGogh1, VanGogh2, VanGogh3, Veronese, and Wissing

n

Number of desired colors. If number of requested colors is beyond the scope of the palette, colors are automatically interpolated. If n is not provided, the length of the palette is used.

type

Either "continuous" or "discrete". Use continuous if you want to automatically interpolate between colors.

direction

Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed

override.order

Colors are picked from palette to maximize readability and aesthetics. This means that colors are not always selected in sequential order from the full palette. If override.order is set to TRUE, colors are selected in sequential order from the full palette instead. Default is FALSE.

Value

A vector of colors.

Examples

met.brewer("VanGogh1")

met.brewer("Greek", direction=-1)

met.brewer("Cassatt2", 4, override.order=TRUE)

library(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"))

Complete list of palettes.

Description

Use names(MetPalettes) to return all possible palette names. Current choices are: Archambault, Austria, Benedictus, Cassatt1, Cassatt2, Cross, Degas, Demuth, Derain, Egypt, Gauguin, Greek, Hiroshige, Hokusai1, Hokusai2, Hokusai3, Homer1, Homer2, Ingres, Isfahan1, Isfahan2, Java, Johnson,Juarez, Kandinsky, Klimt, Lakota, Manet, Monet, Moreau, Morgenstern, Nattier, Navajo, NewKingdom, Nizami, OKeeffe1, OKeeffe2, Paquin, Peru1, Peru2, Pillement, Pissaro, Redon, Renoir, Signac, Tam, Tara, Thomas, Tiepolo, Troy, Tsimshian, VanGogh1, VanGogh2, VanGogh3, Veronese, and Wissing. Use met.brewer to construct palettes.

Usage

MetPalettes

Format

An object of class list of length 56.


MetBrewer palettes for plotting with ggplot2

Description

Function for using MetBrewer colors schemes in ggplot2. Use scale_color_met_d and scale_fill_met_d for discrete scales and scale_color_met_c and scale_fill_met_c for continuous scales.

Usage

scale_color_met_c(name, direction = 1, ...)

Arguments

name

Name of Palette. Choices are: Archambault, Austria, Benedictus, Cassatt1, Cassatt2, Cross, Degas, Demuth, Derain, Egypt, Gauguin, Greek, Hiroshige, Hokusai1, Hokusai2, Hokusai3, Homer1, Homer2, Ingres, Isfahan1, Isfahan2, Java, Johnson,Juarez, Kandinsky, Klimt, Lakota, Manet, Monet, Moreau, Morgenstern, Nattier, Navajo, NewKingdom, Nizami, OKeeffe1, OKeeffe2, Paquin, Peru1, Peru2, Pillement, Pissaro, Redon, Renoir, Signac, Tam, Tara, Thomas, Tiepolo, Troy, Tsimshian, VanGogh1, VanGogh2, VanGogh3, Veronese, and Wissing

direction

Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed

...

Other arguments passed on to scale_color_gradientn

Examples

library(ggplot2)
ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width, color=Sepal.Length)) +
geom_point() +
scale_color_met_c("Isfahan1", direction=-1)

MetBrewer palettes for plotting with ggplot2

Description

Function for using MetBrewer colors schemes in ggplot2. Use scale_color_met_d and scale_fill_met_d for discrete scales and scale_color_met_c and scale_fill_met_c for continuous scales.

Usage

scale_color_met_d(name, direction = 1, override.order = FALSE, ...)

Arguments

name

Name of Palette. Choices are: Archambault, Austria, Benedictus, Cassatt1, Cassatt2, Cross, Degas, Demuth, Derain, Egypt, Gauguin, Greek, Hiroshige, Hokusai1, Hokusai2, Hokusai3, Homer1, Homer2, Ingres, Isfahan1, Isfahan2, Java, Johnson,Juarez, Kandinsky, Klimt, Lakota, Manet, Monet, Moreau, Morgenstern, Nattier, Navajo, NewKingdom, Nizami, OKeeffe1, OKeeffe2, Paquin, Peru1, Peru2, Pillement, Pissaro, Redon, Renoir, Signac, Tam, Tara, Thomas, Tiepolo, Troy, Tsimshian, VanGogh1, VanGogh2, VanGogh3, Veronese, and Wissing

direction

Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed

override.order

Colors are picked from palette to maximize readability and aesthetics. This means that colors are not always selected in sequential order from the full palette. If override.order is set to TRUE, colors are selected in sequential order from the full palette instead. Default is FALSE.

...

Other arguments passed on to discrete_scale

Examples

library(ggplot2)
ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width, color=Species)) +
geom_point() +
scale_color_met_d("Juarez")

MetBrewer palettes for plotting with ggplot2

Description

Function for using MetBrewer colors schemes in ggplot2. Use scale_color_met_d and scale_fill_met_d for discrete scales and scale_color_met_c and scale_fill_met_c for continuous scales.

Usage

scale_colour_met_c(name, direction = 1, ...)

Arguments

name

Name of Palette. Choices are: Archambault, Austria, Benedictus, Cassatt1, Cassatt2, Cross, Degas, Demuth, Derain, Egypt, Gauguin, Greek, Hiroshige, Hokusai1, Hokusai2, Hokusai3, Homer1, Homer2, Ingres, Isfahan1, Isfahan2, Java, Johnson,Juarez, Kandinsky, Klimt, Lakota, Manet, Monet, Moreau, Morgenstern, Nattier, Navajo, NewKingdom, Nizami, OKeeffe1, OKeeffe2, Paquin, Peru1, Peru2, Pillement, Pissaro, Redon, Renoir, Signac, Tam, Tara, Thomas, Tiepolo, Troy, Tsimshian, VanGogh1, VanGogh2, VanGogh3, Veronese, and Wissing

direction

Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed

...

Other arguments passed on to scale_color_gradientn

Examples

library(ggplot2)
ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width, color=Sepal.Length)) +
geom_point() +
scale_colour_met_c("Isfahan1", direction=-1)

MetBrewer palettes for plotting with ggplot2

Description

Function for using MetBrewer colors schemes in ggplot2. Use scale_color_met_d and scale_fill_met_d for discrete scales and scale_color_met_c and scale_fill_met_c for continuous scales.

Usage

scale_colour_met_d(name, direction = 1, override.order = FALSE, ...)

Arguments

name

Name of Palette. Choices are: Archambault, Austria, Benedictus, Cassatt1, Cassatt2, Cross, Degas, Demuth, Derain, Egypt, Gauguin, Greek, Hiroshige, Hokusai1, Hokusai2, Hokusai3, Homer1, Homer2, Ingres, Isfahan1, Isfahan2, Java, Johnson,Juarez, Kandinsky, Klimt, Lakota, Manet, Monet, Moreau, Morgenstern, Nattier, Navajo, NewKingdom, Nizami, OKeeffe1, OKeeffe2, Paquin, Peru1, Peru2, Pillement, Pissaro, Redon, Renoir, Signac, Tam, Tara, Thomas, Tiepolo, Troy, Tsimshian, VanGogh1, VanGogh2, VanGogh3, Veronese, and Wissing

direction

Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed

override.order

Colors are picked from palette to maximize readability and aesthetics. This means that colors are not always selected in sequential order from the full palette. If override.order is set to TRUE, colors are selected in sequential order from the full palette instead. Default is FALSE.

...

Other arguments passed on to discrete_scale

Examples

library(ggplot2)
ggplot(data=iris, aes(x=Sepal.Length, y=Sepal.Width, color=Species)) +
geom_point() +
scale_colour_met_d("Juarez")

MetBrewer palettes for plotting with ggplot2

Description

Function for using MetBrewer colors schemes in ggplot2. Use scale_color_met_d and scale_fill_met_d for discrete scales and scale_color_met_c and scale_fill_met_c for continuous scales.

Usage

scale_fill_met_c(name, direction = 1, ...)

Arguments

name

Name of Palette. Choices are: Archambault, Austria, Benedictus, Cassatt1, Cassatt2, Cross, Degas, Demuth, Derain, Egypt, Gauguin, Greek, Hiroshige, Hokusai1, Hokusai2, Hokusai3, Homer1, Homer2, Ingres, Isfahan1, Isfahan2, Java, Johnson,Juarez, Kandinsky, Klimt, Lakota, Manet, Monet, Moreau, Morgenstern, Nattier, Navajo, NewKingdom, Nizami, OKeeffe1, OKeeffe2, Paquin, Peru1, Peru2, Pillement, Pissaro, Redon, Renoir, Signac, Tam, Tara, Thomas, Tiepolo, Troy, Tsimshian, VanGogh1, VanGogh2, VanGogh3, Veronese, and Wissing

direction

Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed

...

Other arguments passed on to scale_color_gradientn


MetBrewer palettes for plotting with ggplot2

Description

Function for using MetBrewer colors schemes in ggplot2. Use scale_color_met_d and scale_fill_met_d for discrete scales and scale_color_met_c and scale_fill_met_c for continuous scales.

Usage

scale_fill_met_d(name, direction = 1, override.order = FALSE, ...)

Arguments

name

Name of Palette. Choices are: Archambault, Austria, Benedictus, Cassatt1, Cassatt2, Cross, Degas, Demuth, Derain, Egypt, Gauguin, Greek, Hiroshige, Hokusai1, Hokusai2, Hokusai3, Homer1, Homer2, Ingres, Isfahan1, Isfahan2, Java, Johnson,Juarez, Kandinsky, Klimt, Lakota, Manet, Monet, Moreau, Morgenstern, Nattier, Navajo, NewKingdom, Nizami, OKeeffe1, OKeeffe2, Paquin, Peru1, Peru2, Pillement, Pissaro, Redon, Renoir, Signac, Tam, Tara, Thomas, Tiepolo, Troy, Tsimshian, VanGogh1, VanGogh2, VanGogh3, Veronese, and Wissing

direction

Sets order of colors. Default palette is 1. If direction is -1, palette color order is reversed

override.order

Colors are picked from palette to maximize readability and aesthetics. This means that colors are not always selected in sequential order from the full palette. If override.order is set to TRUE, colors are selected in sequential order from the full palette instead. Default is FALSE.

...

Other arguments passed on to discrete_scale

Examples

library(ggplot2)
ggplot(data=iris, aes(x=Species, y=Sepal.Length, fill=Species)) +
geom_violin() +
scale_fill_met_d("Lakota")