The issue here is how heatmap.2
plots a dendrogram
object. heatmap.2
uses the code plot(ddr, horiz = TRUE, axes = TRUE, yaxs = "i", leaflab = "none")
, where ddr
is the dendrogram. You want the axes
argument to be FALSE
. As a workaround, I created a modified version of the heatmap.2
function. See ?plot.dendrogram
for more information.
x = matrix( rnorm(25), ncol=5 )
f = gplots:::heatmap.2
# Edit the appropriate lines of the heatmap.2 function
print(body(f)[[75]]) # The line to edit
# if (dendrogram %in% c("both", "row")) {
# plot(ddr, horiz = TRUE, axes = FALSE, yaxs = "i", leaflab = "none")
# } else plot.new()
body(f)[[75]][[3]][[2]][[4]] = TRUE
print(body(f)[[77]])
# if (dendrogram %in% c("both", "column")) {
# plot(ddc, axes = FALSE, xaxs = "i", leaflab = "none")
# } else plot.new()
body(f)[[77]][[3]][[2]][[3]] = TRUE
f(x)