anova1関数で出る規定の箱ひげ図のデザインを変えることはできますか?
Show older comments
図のようにタイトルや軸のプロパティは変更できますが、箱ひげ図の色や、外れ値の除外などができません。
方法をご教授いただければ幸いです。
Answers (1)
Atsushi Ueno
on 17 Dec 2023
Edited: Atsushi Ueno
on 17 Dec 2023
% サンプルデータ引用先:https://jp.mathworks.com/help/stats/anova1.html#brx09p9-27
strength = [82 86 79 83 84 85 86 87 74 82 78 75 76 77 79 79 77 78 82 79];
alloy = {'st','st','st','st','st','st','st','st',...
'al1','al1','al1','al1','al1','al1',...
'al2','al2','al2','al2','al2','al2'};
xgroupdat = categorical(alloy);
[p,tbl,stats] = anova1(strength,alloy,'off'); % 'off': ANOVA 表と箱ひげ図を表示しない
figure;
b = boxchart(xgroupdat,strength);
b.BoxFaceColor = [0 0.5 0]; % ボックスの色
b.MarkerStyle = "none"; % 外れ値スタイル (none:表示しない)
% b.JitterOutliers = true; % 外れ値マーカー変位 (表示しないからどっちでもいい)
b.Orientation = "vertical"; % ボックス チャートの方向
b.Notch = true; % 中央値比較表示 (true:凹ませる)
3 Comments
Atsushi Ueno
on 17 Dec 2023
Edited: Atsushi Ueno
on 17 Dec 2023
Atsushi Ueno
on 17 Dec 2023
KO
on 20 Dec 2023
Categories
Find more on 反復測定と多変量分散分析 (MANOVA) 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!