Entering edit mode
Kimpel, Mark W
▴
890
@kimpel-mark-w-727
Last seen 10.2 years ago
I would like to "hard code" the colors to be used with certain ranges
of
values for a heatmap. The issue has occurred because I have discovered
than, in a special case of mine, positive numbers are not always
yellow
and negative numbers are not always blue. Below is an extreme example
which demonstrates this behavior. The issue occurs regardless of
whether
scale="none" or scale="row" is used as an argument.
Is there a workaround such that I can use one scale for positive
numbers
and another scale for negatives?
Thanks,
Mark
a <- c(rep(c(-100, -9, -8, -11), 5), -2, 4)
a.mat <- matrix(rep(a, 50), byrow=TRUE, nrow=50)
require(RColorBrewer)
BlYl <- c('#0061FF', '#0A0780','#9D8F00', '#FFF200')
hmcol <- colorRampPalette(BlYl, space = "rgb")(128)
heatmap(a.mat, col=hmcol)
--
---
Mark W. Kimpel MD ** Neuroinformatics ** Dept. of Psychiatry
Indiana University School of Medicine
15032 Hunter Court, Westfield, IN 46074
(317) 490-5129 Work, & Mobile & VoiceMail
(317) 663-0513 Home (no voice mail please)