Heatmap - color key & modifying text
1
0
Entering edit mode
@roth-richard-1424
Last seen 10.2 years ago
Hi, I have created a heatmap using R from some gene expression data and would like to add/modify the following: 1) add a key that shows the heatmap color scheme order, say from low to high 2) modify the row and column text type, point size, color, and maybe bold/italicize them Can anyone help me out? Thanks, Rich Roth, PhD Senior Scientist Molecular Medicine Neurocrine Biosciences 858-617-7204 -------------- next part -------------- "MMS <neurocrine.com>" made the following annotations on 09/15/2005 10:17:29 AM ---------------------------------------------------------------------- -------- This email may contain confidential and privileged material for the sole use of the intended recipient. Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. ====================================================================== ========
• 2.5k views
ADD COMMENT
0
Entering edit mode
@benilton-carvalho-1375
Last seen 4.7 years ago
Brazil/Campinas/UNICAMP
this is what i usually do... you might want to change the function, since it assumes a square matrix. don't forget to load "fields" before. b. > 1) add a key that shows the heatmap color scheme order, say from low to high ## this function assumes a square matrix ## small changes if this is not your case ## but this is what i need for now :) ## ## Call: ## myheatmap(mymatrix, ## order=the.order.you.want.the.matrix.to.be.plotted, ## col=the.colors, ## zr=range.is.vec.2.elements, ## names=vec.with.names.of.columns.rows, ## ...) #whatever you want to send to image() ## ## ## Try: myheatmap(matrix(rnorm(100),ncol=10)) ## ## given my configuration, you'll probably need ## to maximize your window library(fields) myheatmap <- function (mymatrix, order = 1:ncol(mymatrix), col = heat.colors(1024)[1024:1], zr = range(mymatrix), names = NULL, ...){ par(plt = c(0.25, 0.9, 0.1, 0.9)) ncols <- ncol(mymatrix) image(t(mymatrix[order, order])[, ncols:1], col = col, axes = FALSE, zlim = zr, ...) sn <- paste(names(mymatrix),1:ncols)[order] if (!is.null(names)) sn <- paste(sn,names[order]) axis(2, at = (0:(ncols - 1))/(ncols - 1), labels = sn[ncols:1], las = 1) image.plot(t(mymatrix[order, order])[, ncols:1], horizontal = TRUE, legend.only = TRUE, zlim = zr, col = col, smallplot = c(0.25, 0.9, 0.05, 0.095)) }
ADD COMMENT

Login before adding your answer.

Traffic: 569 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6