作者:Zuguang Gu8
    编译:Steven Shen
    原文:Adjust blank space caused by annotations


    The layout of the ComplexHeatmap is not perfect that it is still possible some of the text are drawn out of the plotting region. In this case, you can manually set the padding argument in draw() function to increase the blank areas around the final plot.

    The value of padding should be a unit vector with length of four. The four values correspond to the space at the bottom, left, top and right sides.

    The following example is not a perfect example because the maximal width for row names can be controlled by max_row_name_width argument, but we can still use it to demonstrate the use of padding.

    1. m2 = m
    2. rownames(m2) = paste0("R", 1:10)
    3. rownames(m2)[1] = "a long long long long long row name"
    4. ht = Heatmap(m2, name = "mat", row_names_side = "left", show_row_dend = FALSE)
    5. draw(ht, padding = unit(c(2, 20, 2, 2), "mm")) ## see right heatmap in following

    4.15 手动增加图形周围的空间 - 图1