简体   繁体   English

在dendextend中向树状图添​​加节点标签

[英]Adding node labels to dendrogram plot in dendextend

I have a dendrogram with leaf and node labels (class=phylo, read in using read.tree). 我有一个带有叶子和节点标签的树状图(类= phylo,使用read.tree读入)。 After converting this to dendrogram class the node labels are not there anymore. 将其转换为树状图类之后,不再存在节点标签。 However, I would like to plot the dendrogram by showing labels on top of some nodes (ie in the form NODE_1 etc. on top of the selected clusters). 但是,我想通过在某些节点的顶部显示标签来绘制树状图(即,在所选群集的顶部以NODE_1等形式)。

Does anyone know how can I get node labels to dendrogram class and add them to the plot? 有谁知道如何将节点标签添加到树状图类并将其添加到绘图中? Something similar like this, but instead of numbers there are id-s or labels and only some selection of nodes have the labels. 类似的东西,但是没有数字,而是id-s或标签,只有部分节点具有标签。

在此处输入图片说明

I would convert your dendrogram to phylo class with as.phylo . 我会用as.phylo将您的树状图转换为phylo类。 When plotting you can do plot(phylo, show.node.label = TRUE) . 绘制时可以执行plot(phylo, show.node.label = TRUE)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM