Skip to content

Could anyone tell me how to plot a hierarchical clustering in a black-white color?

3 messages · Frank Duan, Sundar Dorai-Raj

#
Dear R people,

I am trying to do a hierarchical clustering to a matrix using
heatmap() function. But I like to have the plot to display in a
black-white manner? Could anyone tell me how to do that?

Thank you.

Frank
#
Frank Duan wrote:

            
Will ?gray do what you need?

# from ?heatmap
require(graphics)
x  <- as.matrix(mtcars)
rc <- gray(seq(0, 1, len = nrow(x)))
cc <- gray(seq(0, 1, len = ncol(x)))
col <- gray(seq(0, 1, len = 256))
hv <- heatmap(x, col = col, scale="column",
               RowSideColors = rc, ColSideColors = cc, margin=c(5,10),
               xlab = "specification variables", ylab= "Car Models",
               main = "heatmap(<Mtcars data>, ..., scale = \"column\")")

This is for R-2.0.0 on Win2000.

--sundar
#
Thank you very much, Sundar. That's exactly what I want.

Frank


On Thu, 11 Nov 2004 15:19:19 -0800, Sundar Dorai-Raj
<sundar.dorai-raj at pdf.com> wrote: