Skip to contents

Get a color palette for mapping. These palettes were copied from GRASS.

Usage

map.pal(name, n=50, ...)

Arguments

name

character (name of a palette, see Details), or missing (to get the available names)

n

numeric. The number of colors

...

additional arguments that are passed to colorRamp

Value

none

Details

NameDescription
aspectaspect oriented grey colors
bcyrblue through cyan through yellow to red
bgyrblue through green through yellow to red
blueswhite to blue
bygblue through yellow to green
byrblue through yellow to red
curvaturefor terrain curvatures
differencesdifferences oriented colors
elevationmaps relative ranges of raster values to elevation color ramp
grassGRASS GIS green (perceptually uniform)
greenswhite to green
greygrey scale
grey.eqhistogram-equalized grey scale
grey.loghistogram logarithmic transformed grey scale
gyrgreen through yellow to red
haxbyrelative colors for bathymetry or topography
infernoperceptually uniform sequential color table inferno
magmaperceptually uniform sequential color table magma
orangeswhite to orange
plasmaperceptually uniform sequential color table plasma
rainbowrainbow color table
rampcolor ramp
randomrandom color table
redswhite to red
roygbiv
rstcurvterrain curvature
rybred through yellow to blue
rygred through yellow to green
sepiayellowish-brown through to white
viridisperceptually uniform sequential color table viridis
waterwater depth
wavecolor wave

See also

Examples

map.pal("elevation", 10)
#>  [1] "#00BFBF" "#00E254" "#1CFF00" "#A9FF00" "#FFE200" "#FF9B00" "#E97F14"
#>  [8] "#C67F37" "#C39F7B" "#C8C8C8"

r <- rast(system.file("ex/elev.tif", package="terra"))
plot(r, col=map.pal("elevation"))


map.pal()
#>  [1] "aspect"      "bcyr"        "bgyr"        "blues"       "byg"        
#>  [6] "byr"         "curvature"   "differences" "elevation"   "grass"      
#> [11] "greens"      "grey"        "gyr"         "haxby"       "inferno"    
#> [16] "magma"       "oranges"     "plasma"      "rainbow"     "ramp"       
#> [21] "reds"        "roygbiv"     "rstcurv"     "ryb"         "ryg"        
#> [26] "sepia"       "viridis"     "water"       "wave"