Creates a custom color palette based on low, middle, and high color values

BlackAndWhite(mid = NULL, k = 50)

BlueAndRed(k = 50)

CustomPalette(low = "white", high = "red", mid = NULL, k = 50)

PurpleAndYellow(k = 50)

Arguments

mid

middle color. Optional.

k

number of steps (colors levels) to include between low and high values

low

low color

high

high color

Value

A color palette for plotting

Examples

df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
plot(df, col = BlackAndWhite())


df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
plot(df, col = BlueAndRed())


myPalette <- CustomPalette()
myPalette
#>  [1] "#FFFFFF" "#FFFAFA" "#FFF5F5" "#FFEFEF" "#FFEAEA" "#FFE5E5" "#FFE0E0"
#>  [8] "#FFDBDB" "#FFD5D5" "#FFD0D0" "#FFCBCB" "#FFC6C6" "#FFC1C1" "#FFBBBB"
#> [15] "#FFB6B6" "#FFB1B1" "#FFACAC" "#FFA7A7" "#FFA1A1" "#FF9C9C" "#FF9797"
#> [22] "#FF9292" "#FF8D8D" "#FF8787" "#FF8282" "#FF7D7D" "#FF7878" "#FF7272"
#> [29] "#FF6D6D" "#FF6868" "#FF6363" "#FF5E5E" "#FF5858" "#FF5353" "#FF4E4E"
#> [36] "#FF4949" "#FF4444" "#FF3E3E" "#FF3939" "#FF3434" "#FF2F2F" "#FF2A2A"
#> [43] "#FF2424" "#FF1F1F" "#FF1A1A" "#FF1515" "#FF1010" "#FF0A0A" "#FF0505"
#> [50] "#FF0000"

df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
plot(df, col = PurpleAndYellow())