Paolo Lorenzini
Paolo Lorenzini

Reputation: 725

Modify color intensity of Heatmap

I have a data in a binary matrix format (mat) like this:

country.  c1.  c2.  c3. 

 UK.      0.    1.  1

USA.     1.    1.  0

Japan.   0.    0.  0

and I successfully generated a Heatmap with the d3heatmap package in R:

d3heatmap(mat[,2:4], Colv = F,Rowv = F, col=c("white", "blue"), scale="none", cexRow = 0.6,cexCol = 1)

However, when I plot the Heatmap the blue colour intensity of the values with 1 is very faint, because I have set white for the 0 values.

Does anybody know how to make the intensity of the colour darker? Alternatively, anybody knows a good package in R to draw a Heatmap of a binary matrix ?

Upvotes: 0

Views: 162

Answers (1)

Hope
Hope

Reputation: 143

Try demo(colors). You can then see all the named colors R has and choose something other than "white".

For a recommendation I personally like to use levelplot() from the package "lattice".

Upvotes: 1

Related Questions