作者: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
andheatmap_height
control the size of the heatmap. By default, all heatmap components have fixed width or height, e.g. the width of row dendrogram is1cm
. 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.
width
, heatmap_width
, height
和 heatmap_height
都用于控制热图的大小。默认情况下,所有热图组件都具有固定的宽度或高度,例如 行树形图的宽度为 1cm
。热图主体的宽度或高度填充最终绘图区域的其余区域,这意味着,如果您在交互式图形窗口中绘制它并通过拖动来更改窗口的大小,则热图主体的大小为自动调整。
heatmap_width
andheatmap_height
control the width/height of the complete heatmap including all heatmap components (excluding the legends) whilewidth
andheight
only control the width/height of the heamtap body. All these four arguments can be set as absolute units.
heatmap_width
和 heatmap_height
控制整个热图的宽度/高度,包括所有热图组件(不包括图例),而 width
和 height
仅控制 heamtap 主体的宽度/高度。所有这四个参数都可以设置为绝对单位。
Heatmap(mat, name = "mat", width = unit(8, "cm"), height = unit(8, "cm"))
Heatmap(mat, name = "mat", heatmap_width = unit(8, "cm"), heatmap_height = unit(8, "cm"))
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()
andheight()
functions.
当热图的大小设置为绝对单位时,图片的大小可能大于绘图图形的大小,这会给出图周围的空白区域。可以通过 width()
和 height()
函数检索热图的大小。
ht = Heatmap(mat, name = "mat", width = unit(8, "cm"), height = unit(8, "cm"))
ht = draw(ht)
ComplexHeatmap:::width(ht)
## [1] 118.985533333333mm
ComplexHeatmap:::height(ht)
## [1] 114.8515mm
ht = Heatmap(mat, name = "mat", heatmap_width = unit(8, "cm"),
heatmap_height = unit(8, "cm"))
ht = draw(ht)
ComplexHeatmap:::width(ht)
## [1] 95.0216666666667mm
ComplexHeatmap:::height(ht)
## [1] 84mm
——本章节完. 2019-07-08——