将y轴标签移动到heatmap的左侧

Eri*_*erg 6 axis margins heatmap

我想将y轴标签移动到heatmap的左侧.(这与关于在热图上移动轴的问题类似,但不一样)虽然我可以通过编辑heatmap.2函数的第290行来移动轴,但是值会覆盖实际的热图.

if (is.null(srtRow) && is.null(colRow)) {
    axis(4, iy, labels = labRow, las = 2, line = -0.5 + offsetRow, 
         tick = 0, cex.axis = cexRow, hadj = adjRow[1], padj = adjRow[2])
  }

  else {

    if (is.null(srtRow) || is.numeric(srtRow)) {

      xpd.orig <- par("xpd")

      par(xpd = NA)
      ypos <- axis(4, iy, labels = rep("", nr), las = 2, #change
                   line = -0.5, tick = 0)
      text(x = par("usr")[2] + (1 + offsetRow) * strwidth("M"), 
           y = ypos, labels = labRow, adj = adjRow, cex = cexRow, 
           srt = srtRow, col = colRow)
      par(xpd = xpd.orig)
    }
Run Code Online (Sandbox Code Playgroud)

我尝试使用lwid和lhei选项来移动热图的位置.但是覆盖问题仍然存在.

谢谢埃里克