Heatmap palette generation
This function generates a ramp of colors for heat.map
derivated functions.
heat(colors = c("#8888FF", "#000000", "#FF4444"), n = 256, shapeFun = heat.exp, ...) heat.exp(n, part, base = 1.015) heat.lin(n, part)
colors
: Character vector of length 3, determining starting, middle and final colors.n
: Single integer value, amount of colors / values to generate.shapeFun
: Function taking at least 2 arguments : n
and part
. heat.exp
and heat.lin
are provided as examples....
: Further arguments to heat
will be passed to shapeFun
.part
: Single integer, defined as 1 while generating colors between the first two boundaries, and 2 otherwise.base
: Single numeric value, base for exponential slope.heat
returns a character vector of colors in hexadecimal representation.
heat.lin
and heat.expr
return n
numeric values, defining a curve whose slope will be mimiced during color interpolation.
Sylvain Mareschal
colorRampPalette
heat.map
, clusterize
, predict.LPS
# Classical heatmap colors palette <- heat(c("green", "black", "red")) heat.scale(zlim=c(-2,2), col.heatmap=palette) # Two distinct shapes provided heat.scale(zlim=c(-2,2), col.heatmap=heat(shapeFun=heat.lin)) heat.scale(zlim=c(-2,2), col.heatmap=heat(shapeFun=heat.exp))