Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bpy.colors

blue-pink-yellow color scheme, which also prints well on black/white printers


Description

Create a vector of ‘n’ “contiguous” colors.

Usage

bpy.colors(n = 100, cutoff.tails = 0.1, alpha = 1.0)

Arguments

n

number of colors (>= 1) to be in the palette

cutoff.tails

tail fraction to be cut off on each side. If 0, this palette runs from black to white; by cutting off the tails, it runs from blue to yellow, which looks nicer.

alpha

numeric; alpha transparency, 0 is fully transparent, 1 is opaque.

Value

A character vector, ‘cv’, of color names. This can be used either to create a user-defined color palette for subsequent graphics by ‘palette(cv)’, a ‘col=’ specification in graphics functions or in ‘par’.

Note

This color map prints well on black-and-white printers.

Author(s)

unknown; the pallette was posted to gnuplot-info a few decades ago; R implementation Edzer Pebesma, edzer.pebesma@uni-muenster.de

See Also

Examples

bpy.colors(10)
p <- expand.grid(x=1:30,y=1:30)
p$z <- p$x + p$y
coordinates(p) <- c("x", "y")
gridded(p) <- TRUE
image(p, col = bpy.colors(100), asp = 1)
# require(lattice)
# trellis.par.set("regions", list(col=bpy.colors())) # make this default pallette

sp

Classes and Methods for Spatial Data

v1.4-5
GPL (>= 2)
Authors
Edzer Pebesma [aut, cre], Roger Bivand [aut], Barry Rowlingson [ctb], Virgilio Gomez-Rubio [ctb], Robert Hijmans [ctb], Michael Sumner [ctb], Don MacQueen [ctb], Jim Lemon [ctb], Finn Lindgren [ctb], Josh O'Brien [ctb], Joseph O'Rourke [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.