[R] moving color key in heatmap

Dieter Menne dieter.menne at menne-biomed.de
Wed Aug 19 09:16:03 CEST 2009




Booboo Qu wrote:
> 
> 
> I have a question on moving color keys when side color bars are added to a
> heatmap.
> The R code below produces the color key in the upper left corner. Notice I
> have added side bars to the heatmap, but how could I move the color key
> below the image? 
> 

Thanks for the self-contained example. heatmap internally uses layout (see
docs) to arrange the plot, and its parameters can be controlled by lwid and
lhei.
So give the following a try that makes the histogram and the key same size.
However, this does not help in putting the heatmap below, because everything
is plotted in an array arrangement, as you can see from the example. You
would have to change the code to put the Key in a third row; see the region
around "layout" in function heatmap, but it is not easy.

res=heatmap.3(x, RowSideColors=rc, ColSideColors=cc,lwid=c(1.5,1.5),
  lhei=c(1.5,1.5))



-- 
View this message in context: http://www.nabble.com/moving-color-key-in-heatmap-tp25036103p25038995.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list