Plot two or more multcompare results vertically in one figure

조회 수: 2 (최근 30일)
Abdulllah
Abdulllah 2023년 2월 27일
편집: Abdulllah 2023년 2월 27일
Hello,
The multcompare test plots the lines horizontaly while the model names on verticle axis. How can I plot the lines vertically and model names on horizontal axis similar to the give figure. Morever, how can I show the results of two(or more) multicopmare tests in one figure (considerint the results as group data).
Any simple example could be used e.g.,
load carsmall % load data
[p,t,stats1] = anova1(MPG,Origin,'off'); %test 1 for group 1
[c,m,h,nms] = multcompare(stats1); %multicompare 1 for group 1
[p,t,stats2] = anova1(MPG+4,Origin,'off'); %test 2 for group 2
[c,m,h,nms] = multcompare(stats2); %multicompare 2 for group 2
However, I need the output similar to the attached figure

답변 (1개)

Aditya
Aditya 2023년 2월 27일
Hi,
I understand that you want to have the figure rotated.
You can do that programatically using the camroll function.
load carsmall % load data
[p,t,stats1] = anova1(MPG,Origin,'off'); %test 1 for group 1
[c,m,h,nms] = multcompare(stats1); %multicompare 1 for group 1
[p,t,stats2] = anova1(MPG+4,Origin,'off'); %test 2 for group 2
[c,m,h,nms] = multcompare(stats2); %multicompare 2 for group 2
camroll(90)
You can use Rotate 3D Tool of figure for changing orientation in general
For plotting together, there are many strategies. You can try using subplot
load carsmall % load data
[p,t,stats1] = anova1(MPG,Origin,'off'); %test 1 for group 1
camroll(90)
subplot(1,2,1)
[c,m,h,nms] = multcompare(stats1); %multicompare 1 for group 1
[p,t,stats2] = anova1(MPG+4,Origin,'off'); %test 2 for group 2
subplot(1,2,2)
[c,m,h,nms] = multcompare(stats2); %multicompare 2 for group 2
  댓글 수: 1
Abdulllah
Abdulllah 2023년 2월 27일
편집: Abdulllah 2023년 2월 27일
For this type of graph, 3D creates just mess. It shifts the axis, mixup the text etc. I am looking for a proper solution e.g., similar to group bar charts or group box plots. I wonder why it does not have verticle direction. I am happy the staff has responded me. Is it possible for you to please find some proper solution, since the subplot is also not doing the job similar to what I need (as show in attached figure). Thank you.
p.s. My data is actually different. for each group. If I use the subplot, all the axis are different. I need to use single axis. I can re-set the axis but I have to do many plots so this solution is not convinient.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Spectral Estimation에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by