作者:Zuguang Gu
翻译:Steven Shen
原文:https://jokergoo.github.io/ComplexHeatmap-reference/book/a-single-heatmap.html#size-of-the-heatmap

2.10 热图尺寸

2.10 Size of the heatmap

width, heatmap_width, height and heatmap_height control the size of the heatmap. By default, all heatmap components have fixed width or height, e.g. the width of row dendrogram is 1cm. The width or the height of the heatmap body fill the rest area of the final plotting region, which means, if you draw it in an interactive graphic window and you change the size of the window by draging it, the size of the heatmap body is automatically adjusted.

widthheatmap_widthheightheatmap_height 都用于控制热图的大小。默认情况下,所有热图组件都具有固定的宽度或高度,例如 行树形图的宽度为 1cm 。热图主体的宽度或高度填充最终绘图区域的其余区域,这意味着,如果您在交互式图形窗口中绘制它并通过拖动来更改窗口的大小,则热图主体的大小为自动调整。

heatmap_width and heatmap_height control the width/height of the complete heatmap including all heatmap components (excluding the legends) while width and height only control the width/height of the heamtap body. All these four arguments can be set as absolute units.

heatmap_widthheatmap_height 控制整个热图的宽度/高度,包括所有热图组件(不包括图例),而 widthheight 仅控制 heamtap 主体的宽度/高度。所有这四个参数都可以设置为绝对单位。

  1. Heatmap(mat, name = "mat", width = unit(8, "cm"), height = unit(8, "cm"))

2.10 热图尺寸 - 图1

  1. Heatmap(mat, name = "mat", heatmap_width = unit(8, "cm"), heatmap_height = unit(8, "cm"))

2.10 热图尺寸 - 图2

These four arguments are more important when adjust the size in a list of heatmaps (see Section 4.2).

调整热图列表中的大小时,这四个参数更为重要(参见第 4.2 节)。

When the size of the heatmap is set as absolute units, it is possible that the size of the figure is larger than the size of the plot, which gives blank areas around the plot. The size of the heatmap can be retrieved by width() and height() functions.

当热图的大小设置为绝对单位时,图片的大小可能大于绘图图形的大小,这会给出图周围的空白区域。可以通过 width()height() 函数检索热图的大小。

  1. ht = Heatmap(mat, name = "mat", width = unit(8, "cm"), height = unit(8, "cm"))
  2. ht = draw(ht)
  3. ComplexHeatmap:::width(ht)
  4. ## [1] 118.985533333333mm
  5. ComplexHeatmap:::height(ht)
  6. ## [1] 114.8515mm
  1. ht = Heatmap(mat, name = "mat", heatmap_width = unit(8, "cm"),
  2. heatmap_height = unit(8, "cm"))
  3. ht = draw(ht)
  4. ComplexHeatmap:::width(ht)
  5. ## [1] 95.0216666666667mm
  6. ComplexHeatmap:::height(ht)
  7. ## [1] 84mm

——本章节完. 2019-07-08——