Re: [R] heatmap.2 - change column & row locations; angle / rotate

From: Karl Brand <>
Date: Mon, 18 Apr 2011 18:23:12 +0200

Hi Chakravarthy,

[dont forget to Cc the list for useRs with the same Q.]

If you're trying to reuduce the isze of your row or column labels, i think the following arguments of heatmap.2 {gplots} is what you want to adjust- 'cexCol' and 'cexRow'.

Specifically on my question that you ask about, i found the BioC forum helpful:

And in fact the phylotemp() function by default pretty much did exactly what i needed, available here:

However, it was pointed out to me that some times the best way to get it just right is using more basic functions, which for heatmaps would be image(). See:



On 04/18/2011 10:38 AM, wrote:
> Dear Karl Brand,
> I am facing same problem as you have faced before (see appended mail below). I am writing to you to find out whether you have found a solution !
> I asked a similar question in R-forum (
> Any pointers would be greatly appreciated
> Thanks
> Chakravarthy
> Junior Research Fellow
> Tata Institute of Fundamental Research
> Bangalore, India
> <quote author='Karl Brand'>
> Esteemed R user's,
> I'm struggling to achieve some details of a heatmap using heatmap.2():
> 1. Change label locations, for both rows& columns from the default
> right& bottom, to left and top.
> Can this be done within heatmap.2()? Or do i need to suppress this
> default behavior (how) and call a new function to relabel (what)
> specifying locations?
> 2. Change the angle of the labels.
> By default column labels are 90deg anti-clock-wise from horizontal. How
> to bring them back to horizontal? Or better, rotate 45deg clock-wise
> from horizontal (ie., rotate 135deg a.clock.wise from default)?
> Any suggestions or pointers to helpful resources greatly appreciated,
> Karl

Karl Brand <>
Department of Genetics
Erasmus MC
Dr Molewaterplein 50
3015 GE Rotterdam
P +31 (0)10 704 3455 | F +31 (0)10 704 4743 | M +31 (0)642 777 268

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Mon 18 Apr 2011 - 16:30:04 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 18 Apr 2011 - 16:30:31 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive