how can i plot overlapping dendrograms with manovacluster or similar manova output ?

3 views (last 30 days)
I have reasson to try to compare mANOVA results in different ways (e.g, for comparing mahalanobis distances at different times) and plot multiple manovacluster output ONTO the same axes. The latter part is the problem.
What seems to happen is that the call to manovacluster always populates a new figure whenever hold on is true.
e.g a MWE
load carbig
X = [MPG Acceleration Weight Displacement];
[d,p,stats] = manova1(X,Origin);
h1 = manovacluster(stats); %
hold on;
X2 = [flipud(MPG) Acceleration flipud(Weight) Displacement];
[~,~,stats2] = manova1(X2,Origin)
h2 = manovacluster(stats2); % This will ALWAYS be in a separate figure than the figure for hi
an even more-minimal working example is this... even in an empty figure, a new figure is generated if hold on is true.
figure;
hold on;
X2 = [flipud(MPG) Acceleration flipud(Weight) Displacement];
[~,~,stats2] = manova1(X2,Origin)
h2 = manovacluster(stats2);
I suspect that dendrogram underlying the whole thing reqires new axes every time, and refuses to inherit an axis or something. But the axes (the horizontal one, at least) here will be identical. I'm unable to find any community Q/A or examples of overlapping dendograms, and it doesn't seem too crazy to want to do this. Any known workarounds?
(I suspect a simple solution combinng h1 = [h1; h2] into a single giant array of line handles, but i'm not sure what to do with them after than.)

Answers (0)

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!