How to plot number of box plots in a single figure? each box plot is a verctor of variable length.

Also i have data in csv file in which each vector is of variable length. I want to normalize each vector by a certain value as well. Looking forward for a quick response. Thanks

답변 (1개)

Jos (10584)
Jos (10584) 2014년 2월 10일
편집: Jos (10584) 2014년 2월 10일
Here is an example.
% Given two column vectors with different lengths
V1 = 5 + 10 * randn(7,1) ;
V2 = 10 + 20 * randn(13,1) ;
% You can use subplots:
figure
subplot(2,2,1) ; boxplot(V1)
subplot(2,2,2) ; boxplot(V2)
% Or plot them in a single axes by padding the vectors with NaNs.
figure
M = padcat(V1,V2) ;
boxplot(M) % NaNs are ignored
The latter seems more informative to me ...
PADCAT can be downloaded from the File Exchange:

댓글 수: 2

Actually subplot makes the subplots, i need plots side by side. here is the example picture attached
I foresaw that, so that's why added the second option using PADCAT …

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

카테고리

태그

질문:

2014년 2월 10일

댓글:

2014년 2월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by