Question

I am using R version 2.12.1 on Win XP.

I have done a heatmap with dendrogram using the heatmap.2 function.

The heatmap basically looks like I want it to be, but the labels of the columns are cut off.

I.e. the textual labels of the columns, although they are not very long (less than 12 characters), do not fit into the window and can not be read entirely.

If I manually resize the graphics window, the entire hetmap is rescaled, so this doesn't help at all.

How can I change the output size so that I can read the labels infull? (final goal is PNG and PDF).

Thanks.

Was it helpful?

Solution

Just wanted to answer my own question, as I figured it out now: the parameter "margins" of heatmap.2 controls how much space is used for the margins.

OTHER TIPS

You can use margins option in heatmap.2 margins=c(10,10) depending on the output format (eg., png will be pixels)

You can control this by using the "res" option in any one of jpeg(), bmp(), png()

Example:

bmp(filename = "X", width = 480, height = 480, res=72)
heatmap(...)

Adjust res as needed, lower makes it smaller and vice versa.

What about adjusting the cexRow and cexCol values in the heatmap.2 arguments, i.e. reduce the font size.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top