Labeling Dendrogram Plot x-axis
12 次查看(过去 30 天)
显示 更早的评论
Hello,
i worked me trough the example on how to make clusteranalysis
everything works fine except that i cant label my x-axis (hirachical clustering). so i have now the clutered tree but i dont know what 'branch' belongs to my rawdata. so lets say i have a data matrix of 6 colums and 40 rows, and i cant link the actual data to one of the branches because branch one on the plot is not necessarely the first row in my matrix
has anybody an idea how to solve this? thank you in advance
load fisheriris
eucD = pdist(meas,'euclidean');
clustTreeEuc = linkage(eucD,'average');
[h,nodes] = dendrogram(clustTreeEuc,0);
set(gca,'TickDir','out','TickLength',[.002 0],'XTickLabel',[]);
0 个评论
采纳的回答
Tom Lane
2013-2-1
You can try this:
> [h,nodes,orig] = dendrogram(clustTreeEuc,0);
>> orig(1:5)
ans =
102 143 114 122 115
These are the first five points (using original row numbers) on the dendrogram. If you zoom into the cluttered plot, you will see the first points are labeled this way. Now unclutter using:
>> set(gca,'XTickMode','auto','XTickLabelMode','auto');
Now the first five points are at positions 1,2,3,4,5. Zoom out. The graph is uncluttered. You can determine the identity of any leaf node by finding its x value (zooming if necessary) and looking up the original row number in the orig vector.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Axis Labels 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!