boxplot - different group sizes

I would like to create a boxplot showing multiple groups, each of which has a different number of observations. How do I do this?

回答 (1 件)

Oleg Komarov
Oleg Komarov 2011 年 5 月 18 日

0 投票

Say you have:
A = rand(20,1);
and you want the first 5 value to be for one group, then the rest 15 for the second. Create and index with five 1s and fifteen 2s:
G = [ones(5,1); repmat(2,15,1)];
boxplot(A,G)
For details read carefully the documentation.

1 件のコメント

Matt Tearle
Matt Tearle 2011 年 5 月 18 日
In particular, look at the 'factorgap' and 'positions' properties, for grouping by location.

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

タグ

質問済み:

2011 年 5 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by