How do I make a boxplot with a few groups?

조회 수: 49 (최근 30일)
Ziv Kassner
Ziv Kassner 2020년 9월 1일
댓글: Adam Danz 2020년 9월 24일
a = rand(10,2);
b = rand(10,2);
boxplot([a,b]);
I want to have one figure with to groups - a and b, where the two vectors of 'a' will be close and the two vectors of 'b' will be close, but the two groups will be far from one another.
Thanks,
Ziv
  댓글 수: 1
Adam Danz
Adam Danz 2020년 9월 24일
In addition to Abdolkarim Mohammadi-Balani's perfectly fine answer,

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

답변 (1개)

Abdolkarim Mohammadi
Abdolkarim Mohammadi 2020년 9월 1일
편집: Abdolkarim Mohammadi 2020년 9월 1일
You can add some columns of NaN.
a = rand(10,2);
b = rand(10,2);
c = nan(10,2);
boxplot([a,c,b]);
xticks ([1,2,5,6]);
xticklabels (["a1","a2","b1","b2"]);

카테고리

Help CenterFile Exchange에서 Exploration and Visualization에 대해 자세히 알아보기

태그

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by