Reputation: 51
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
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")
Upvotes: 12