unexpected boxplot behaviour using position option

Hi,
I am plotting several boxplots with boxes arranged in groups using the position option. Now I ran into some strange behaviour, when I try to plot a multiple box with a single datapoint each. Is boxplot really messing up the positions, or am I lacking some basic usage of boxplot?
Why are in the example the labeling and positions messed up in subplot 2?
if true
figure;
subplot(2,2,1)
boxplot([1:10],[1:10],'position',[1:10]);
subplot(2,2,2)
boxplot([[1:5],0.2+[1:5]],[[1:5],0.2+[1:5]],'position',[[1:5],0.2+[1:5]]);
subplot(2,2,3)
boxplot([[1:5],0.2+[1:5]],1:10,'position',[[1:5],0.2+[1:5]]);
subplot(2,2,4)
boxplot([[1:5],0.2+[1:5] 1.4],[[1:5],0.2+[1:5],1.2],'position',[[1:5],0.2+[1:5],1.2]);
end

Answers (0)

Products

Tags

Asked:

on 20 Jun 2017

Community Treasure Hunt

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

Start Hunting!