3

I used the following code:

library("gplots")
heatmap.2(assay(vsd)[ens_union,], trace = "none", density.info = "none")

To produce the following heatmap:

heatmap.2: row labels cut-off

As you can see, the row labels have been cut-off (the first one should, for instance, be ENSMUSG00000000088, but only ENSMUSG0 is displayed). How can I re-size the plot to include the whole labels?

Mehdi Nellen
  • 8,486
  • 4
  • 33
  • 48
Nick
  • 2,924
  • 4
  • 36
  • 43
  • Looking at the documentation `?gplots::heatmap.2`, it appears that you can pass arguments to `?par` directly. `mai= c(b, l, t, r)` controls the image margins – alexwhitworth Feb 16 '15 at 17:26

1 Answers1

7

Just add the margins argument

library("gplots")

# generate some example data
data <- as.matrix(mtcars)

# make ridiculously long names
long.names     <- paste("ENSMUSG000000000", rownames(mtcars))
rownames(data) <- long.names

# GO!
heatmap.2(data, trace = "none", density.info = "none", 
          margins = c(8, 16)) 

Don't forget you can also change the font size if you like with cexRow

Mehdi Nellen
  • 8,486
  • 4
  • 33
  • 48