Copying (copyobj) boxplot from anova1 to new subplot
25 ビュー (過去 30 日間)
古いコメントを表示
Hi all.
I am using the anova1 function to produce a set of boxplots, which I then want to copy to a subplot alongside another figure.
When I do that using the code below, the boxes themselves scale perfectly fine, but it groups the boxes with the axis from the original figure and neglects to scale them, meaning in the subplot there are two axis set, one linked to the boxes but scaled wrong, and one on the subplot that work fine (see bottom plot in image). Any ideas on how to fix this?
Code:
stats = anova1(lam);
% Prepare ANOVA boxplot for copying
f = gcf;
axis off
hgsave(f,'two.fig')
close(f)
% Create figure
figure;
a1 = subplot(2,1,1);
First subplot code
a2 = subplot(2,1,2);
f_c = openfig('two.fig');
%Copy boxplot
hg1 = get(gca,'Children');
ch = get(hg1,'Children');
set(a2,'Xlim',[0,11])
copyobj(ch,a2)
close(f_c);
delete('two.fig');

0 件のコメント
採用された回答
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で ANOVA についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!