Frank Duan
2004-Nov-11 23:00 UTC
[R] Could anyone tell me how to plot a hierarchical clustering in a black-white color?
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
Sundar Dorai-Raj
2004-Nov-11 23:19 UTC
[R] Could anyone tell me how to plot a hierarchical clustering in a black-white color?
Frank Duan wrote:> 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 >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