Read the description of 'whisker' carefully...particularly the very last sentence below (emphasis mine):
"boxplot draws points as outliers if they are greater than q3 + w × (q3 – q1) or less than q1 – w × (q3 – q1), where w is the maximum whisker length, and q1 and q3 are the 25th and 75th percentiles of the sample data, respectively.
The default value for 'Whisker' corresponds to approximately +/–2.7σ and 99.3 percent coverage if the data are normally distributed. The plotted whisker extends to the adjacent value, which is the most extreme data value that is not an outlier."
The first point plotted as outlier is >100 which matches up with your wUpper computed value and the whisker extends to
>> xs=sort(x);
>> xs(find(xs>=wUpper,1)-1)
ans =
45.4000
>> hold on
>> plot(1,ans,'r*')
>>
So, the plot is precisely what is described...the whisker indicates the actual location of the last non-outlier, not the boundary value that in general doesn't match any observation.
Best Answer