user6336850
user6336850

Reputation: 51

Remove row and column names - heatmap.2

I am drawing a heatmap and I do not want the row names and column names to be visible on x and y axes.

So I used the following code:

heatmap.2(data, xlab="PROTEINS", ylab="DRUGS", labRow=FALSE, labCol = FALSE)

Then there is a big space between heatmap and PROTEINS and DRUGS labels on each axis.

Upvotes: 2

Views: 23666

Answers (1)

Sudhir
Sudhir

Reputation: 176

Try to play around with the margins parameter. Add something like:

#dummy data
x  <- as.matrix(mtcars)

heatmap.2(x, xlab = "PROTEINS", ylab = "DRUGS",
          labRow = FALSE, labCol = FALSE,
          main = "Without xy names")

heatmap.2(x, xlab = "PROTEINS", ylab = "DRUGS",
          labRow = FALSE, labCol = FALSE,
          margins = c(2, 2),
          main = "Without xy names, margin")

enter image description here

Upvotes: 12

Related Questions