r - Heatmap.2 color gradient with an additional solid color -
the heatmap using creates gradient 0.7 1.3 using heatmap.2
:
heatmap.2(lifespan.matrix, col=bluered, breaks=c(seq(0.7,1.3,0.01)), rowv = false, colv = false, trace="none", main="lifespan")
in heatmap can see gradient emerge ending oftenly in solid blue line. happens because of 0 values in matrix @ these points.
i'd change color, in matrix noted 0, different color i.e. yellow. me problem?
breaks <- seq(0.7,1.3,0.01) lifespan.matrix <- matrix(sample(c(breaks,rep(0,100)),100,replace=true),nrow=10) heatmap.2(lifespan.matrix, col=c("#ffff00",bluered(length(breaks)-2)), breaks=breaks, rowv = false, colv = false, trace="none", main="lifespan")
you specify exact colors associated breaks.
Comments
Post a Comment