bivariate: Bivariate palettes

Description Usage Arguments Details Value Author(s) References Examples

Description

Color palettes designed for bivariate choropleth maps.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

Arguments

n

Number of colors to return.

Details

In many of these palette names, the color in the upper left corner is given first, and the color in the lower right corner is given second.

The 'brewer.*' palettes use 'bin' (binary), 'div' (diverging), 'qual' (qualitative), 'seq' (sequential) for the horizontal and vertical directions.

The 'arc.bluepink' palette uses white in the lower-left corner, which makes it difficult to see the difference between low values and missing data on maps.

The 'census.blueyellow' palette is slightly different, in that one direction uses lightness, and the other direction uses hue (yellow, green, blue).

The 'vsup.*' palettes are Value-Suppressing Uncertainty Palettes.

We strongly recommend not using 'vsup.viridis', because the horizontal axis has changes in brightness, which are confounded with the changes in brightness in the vertical axis.

These palettes are all deliberately chosen to be discrete.

Bivariate color palettes can be difficult to use and interpret. Please be careful.

Value

A vector of colors as hex strings.

Author(s)

Palette colors by various authors. R code by Kevin Wright.

References

Joshua Stevens. http://www.joshuastevens.net/cartography/make-a-bivariate-choropleth-map/

Cindy Brewer. http://www.personal.psu.edu/cab38/ColorSch/Schemes.html

Michael Correll AND Dominik Moritz AND Jeffrey Heer. (2018). Value-Suppressing Uncertainty Palettes. https://github.com/uwdata/papers-vsup

Robin Tolochko. http://tolomaps.tumblr.com/post/131671267233/creating-a-bivariate-choropleth-color-scheme

Aileen Buckley. https://www.slideshare.net/aileenbuckley/arc-gis-bivariate-mapping-tools-28903069

https://www.census.gov/population/www/cen2000/atlas/ Total Population, p. 4.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
bivcol <- function(pal, nx=3, ny=3){
  tit <- substitute(pal)
  if(is.function(pal)) pal <- pal()
  ncol <- length(pal)
  if(missing(nx)) nx <- sqrt(ncol)
  if(missing(ny)) ny <- nx
  image(matrix(1:ncol, nrow=ny), axes=FALSE, col=pal)
  mtext(tit)
}
op <- par(mfrow=c(4,4), mar=c(1,1,2,1))
bivcol(arc.bluepink)
bivcol(brewer.divbin, nx=3)
bivcol(brewer.divdiv)
bivcol(brewer.divseq)
bivcol(brewer.qualbin, nx=3)
bivcol(brewer.qualseq)
bivcol(brewer.seqseq1)
bivcol(brewer.seqseq2)
bivcol(census.blueyellow)
bivcol(stevens.bluered)
bivcol(stevens.greenblue)
bivcol(stevens.pinkblue)
bivcol(stevens.pinkgreen)
bivcol(stevens.purplegold)
bivcol(tolochko.redblue)
bivcol(vsup.redblue, nx=8)
par(op)

pals documentation built on Dec. 5, 2019, 1:08 a.m.