Skip to content
Prev 179343 / 398506 Next

Heatmap without levelplot

Antje wrote:
Well, of you have 5 at locations (i.e. breaks), then you have 4 
intervals in between and that's the amount of colors that is sensible.
Maybe:

Say you want everything below -1 be considered as a lower outlier and 
all above 1 is a higher outlier, then you can say:


levelplot(matrix(c(1,2,0,-2), nrow=2),
     at = c(-Inf, seq(-1, 1, length=10), Inf),
     col.regions = c(rgb(0,1,0),
          hcl(seq(20, 80, length=10), c=400),
          rgb(0,0,1)))

Then below -1 is green (rgb(0,1,0)), above 1 is blue (rgb(0,0,1)) and in 
between we have 10 regions from -1 to 1 each with a color between some 
kind of yellow and red in hcl() space.


Uwe Ligges