How to plot multiple multcompare plots from anova
Show older comments
It doesn't work when I try to use tiledlayout to make a combined plot
% Loading data
y = [52.7 57.5 45.9 44.5 53.0 57.0 45.9 44.0]';
g1 = [1 2 1 2 1 2 1 2];
g2 = {'hi';'hi';'lo';'lo';'hi';'hi';'lo';'lo'};
g3 = {'may';'may';'may';'may';'june';'june';'june';'june'};
% For loop with subplot
for n = 1:4
subplot(2,2,n)
hold on
[~,~,stats] = anovan(y,{g1 g2 g3},'model','interaction','varnames',{'g1','g2','g3'});
results = multcompare(stats,'Dimension',[1 2]);
hold off
end
And tiledlayout also doesn't work
tiledlayout('flow')
nexttile
[~,~,stats] = anovan(y,{g1 g2 g3},'model','interaction','varnames',{'g1','g2','g3'});
results = multcompare(stats,'Dimension',[1 2]);
nexttile
[~,~,stats] = anovan(y,{g1 g2 g3},'model','interaction','varnames',{'g1','g2','g3'});
results = multcompare(stats,'Dimension',[1 2]);
Accepted Answer
More Answers (0)
Categories
Find more on Analysis of Variance and Covariance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!