ropensci/iheatmapr

Customized colorbar scale

dasiav7 opened this issue · 3 comments

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

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

Hi,
Please see the image below. Thank you!

customised colorbar

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.