How could I change the axis for a boxplot that is automatically produced from ANOVA test?

4 ビュー (過去 30 日間)
Bella
Bella 2020 年 12 月 20 日
回答済み: Ive J 2020 年 12 月 20 日
How could I change the axis on my boxplot? I did a ANOVA test and a box-plot was automatically produced. I have 3 groups for my analysis. By default, the group was labelled as 1, 2, 3 accordingly. I would like to change it to A, B, C.
I have tried to do something like this (see below), but it did not work.
boxplot([x1,x2],'Notch','on','Labels',{'A','B','C'})
  1 件のコメント
Olisa Ezeh
Olisa Ezeh 2020 年 12 月 20 日
put a screen shot of your code workspace with all the syntaxes and variables

サインインしてコメントする。

採用された回答

Ive J
Ive J 2020 年 12 月 20 日
You can set XTickLabel property of the generated boxplot.
mydata = randn(20, 3);
anova1(mydata);
set(gca, 'XTickLabel', {'A', 'B', 'C'}) % the last gca is the boxplot by default.
Alternatively, use group argument of anova1:
mydata = rand(1, 60);
group = repmat({'A', 'B', 'C'}, 1, 20);
anova1(mydata, group)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnalysis of Variance and Covariance についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by