add a distinct color for a specific value in the legend color map
Source:R/utilFuns.R
addSingleValue.Rd
add a distinct color for a specific value in the legend color map
Arguments
- ColMap
a named numeric vector,e.g.
c('yellow'=0,'red'=8.99,'green4*'=9)
- s1, s2
portion of the whole legend; they are used to control the width of the color band for the specific value; for example
c('yellow'=0,'red'=8.95,'green4*'=9)
, the width is8.95*(1+s2) to 9
c('yellow*'=0,'red'=0.05,'green4'=9)
, the width is0 to 0.05*(1-s2)
c('yellow'=0,'red*'=1,'green4'=9)
, the width is1*(1-s1) to 1*(1+s1)