Learn R Programming

supraHex (version 1.10.0)

visColormap: Function to define a colormap

Description

visColormap is supposed to define a colormap. It returns a function, which will take an integer argument specifying how many colors interpolate the given colormap.

Usage

visColormap(colormap = c("bwr", "jet", "gbr", "wyr", "br", "yr", "rainbow", "wb"))

Arguments

colormap
short name for the colormap

Value

  • palette.name: a function that takes an integer argument for generating that number of colors interpolating the given sequence

See Also

visColoralpha

Examples

Run this code
# 1) define "blue-white-red" colormap
palette.name <- visColormap(colormap="bwr")

# 2) use the return function "palette.name" to generate 10 colors spanning "bwr"
palette.name(10)

Run the code above in your browser using DataLab