Dendrogram Figure Not Being Displayed
6 views (last 30 days)
Show older comments
Hello,
I have a question and any help/ feedback would be highly appreciated.
Working part of the code
1. We have a collection of 799x799 distance matrices. 2. We are looking at one of them (799x799) and turning it into a pdist like vector of dissimilarity (code included) 3. We then create a hierarchical tree (Z = linkage(a_vec)) 4. We can now create a dendrogram using [H, T, outperm] = dendrogram(Z, 0); and all works fine.
Issue:
This is where the issue starts.
5. We would like to reorder leaves 6. We have a vector, Leaforder in this case that we would like to use. 7. The moment we run "[H, T, outperm] = dendrogram(Z, 0, 'Reorder', Leaforder);" or any other similar command re-ordering leaves, we can see that figure() is started but it never has the dendrogram displayed. 8. We have tried using different variations but the actual dendrogram never shows up. 9. All other variables are created just fine e.g. H, T, outperm 10. We are actually able to examine outperm as well.
//
// Begin Code
load('C:\task_result.mat'); %for r=9:10%numel(obj.result.foundRepro)
a=(obj.result.foundRepro{1})'; % consider the first IC a=max(max(a))-a; % convert into dissimilarity matrix
a_vec=[]; for i=1:799 a_vec=[a_vec a(i+1:799,i)']; % create a vector of dissimilarity such that its structure is similar to the output of pdist function end
Z=linkage(a_vec); % create a heirarchical tree % start reading leaf re-order fid = fopen('C:\reorder.txt'); %leaf re-order being read into data data = textscan(fid, '%s'); fclose(fid); %end leaf re-order read
%data{1} % confirm leaf re-order read Leaforder = data{1}; % assigning leaf order to a variable set (0, 'RecursionLimit', 5000); %Leaforder %Z %numel(Z) %[H, T, outperm] = dendrogram(Z, 0, 'ColorThreshold', 10 , 'Orientation', 'left') % This works! [H, T, outperm] = dendrogram(Z, 0, 'Reorder', Leaforder);
// End Code
Many thanks!
0 Comments
Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!