iheatmapr icon indicating copy to clipboard operation
iheatmapr copied to clipboard

Customized colorbar scale

Open dasiav7 opened this issue 7 years ago • 3 comments

Is it possible to set the colorscale that most value are white which means that not just the midpoint is white?

dasiav7 avatar Apr 24 '18 07:04 dasiav7

Not sure I understand -- can you please provide a more concrete example?

AliciaSchep avatar Apr 26 '18 03:04 AliciaSchep

Hi, Please see the image below. Thank you!

customised colorbar

dasiav7 avatar Apr 26 '18 09:04 dasiav7

Thanks for clarification. Unfortunately this is not easy with package as of now. A hacky work-around is to pass a vector of colors with several instances of "white", e.g:

mat <- matrix(rnorm(36),nrow = 6)
iheatmap(mat, colors = c("darkred","red","white","white","white","green","darkgreen")) 

Adjusting the number of colors specified, the fraction that are white, could give you the effect you're looking for.

AliciaSchep avatar Apr 30 '18 05:04 AliciaSchep