Labeling Dendrogram Plot x-axis
조회 수: 4 (최근 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!