更改绘制谱系图中的标签大小。

huangapple go评论54阅读模式
英文:

Change label size in plot.dendrogram

问题

我想要减小构成我的谱系图的文字的大小。

到目前为止,我的代码,但它不会减小文字的大小:

hc_sbd_1 <- tsclust(result3_2, type = "h", k= 10,
                  distance = "sbd", 
                  control = hierarchical_control(method = "ward.D"))

hc_sbd_1 <- as.dendrogram(hc_sbd_1, cex = 0.2)
plot(hc_sbd_1)

这是我的谱系图。

英文:

I would like to reduce the size of the words that make up my dendrogram.

My code so far, but it doesn't reduce the size of the words:

           hc_sbd_1 &lt;- tsclust(result3_2, type = &quot;h&quot;, k= 10,
              distance = &quot;sbd&quot;, 
              control = hierarchical_control(method = &quot;ward.D&quot;))


            hc_sbd_1  &lt;- as.dendrogram(hc_sbd_1, cex = 0.2)
            plot(hc_sbd_1)

This is my dendrogram

更改绘制谱系图中的标签大小。

答案1

得分: 1

你也可以使用dendextend R包来对输出进行精细控制。

例如,您可以使用as.dendrogram将hclust更改为dendrogram,然后使用dendextend中的set函数与"labels_cex"来更改标签的大小。

英文:

You can also use the dendextend R package to get a very refined control of the output.

E.g. you can change the hclust to dendrogram using as.dendrogram, and then use the set function (from dendextend) with the "labels_cex" to change the sizes of the labels.

huangapple
  • 本文由 发表于 2023年5月21日 00:38:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/76296278.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定