Learn R Programming

bossMaps (version 0.1.0)

hcols: Aesthetically pleasing color ramp for plotting habitat suitability

Description

Aesthetically pleasing color ramp for plotting habitat suitability

Usage

hcols(x, bias = 1)

Arguments

x
number of colors to return
bias
a positive number. Higher values give more widely spaced colors at the high end (as in colorRampPalette).

Value

Returns a character vector of colors (see rgb) interpolating the given sequence (similar to heat.colors or terrain.colors.

Examples

Run this code
library(ggplot2)
data=cbind.data.frame(expand.grid(x=1:10,y=1:10),z=rnorm(100))
ggplot(data,aes(x=x,y=y,fill=z))+geom_raster()+
scale_fill_gradientn(colours=hcols(20,bias=2))

Run the code above in your browser using DataLab