give name to node in dendrogramm
古いコメントを表示

hi guys! I need to rename number-node on the right side of this dendrogramm, how I can do that? tnx!
採用された回答
その他の回答 (1 件)
Kelly Kearney
2016 年 10 月 7 日
The answer will depend on whether you're showing all the leaves of the dendrogram or not. If yes, then the 'Labels' input will do the trick:
X = rand(50,2);
Y = pdist(X,'cityblock');
Z = linkage(Y,'average');
labels = cellstr(num2str((1:size(X,1))', 'test%d'));
dendrogram(Z, 0, 'Labels', labels, 'orientation', 'left');
If you're truncating the leaves (second input >0 and <size(X,1)), things get a little more complicated, since the above only labels single-node leaves. I've done it, but would have to dig around for the code... so comment if you need that.
1 件のコメント
Ben
2022 年 10 月 12 日
Hi Kelly, I'm trying to get the x-axis labels to work with truncated leaves - do you have the code to share? I realise this is a very old thread!
カテゴリ
ヘルプ センター および File Exchange で Axis Labels についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!