Lower whisker and outliers not showing up on boxplot
4 views (last 30 days)
Show older comments
I'm trying to make a boxplot with 9 boxes, and the lower whiskers and outliers are not displaying correctly. On the leftmost box, the lower whisker only appears when the whisker length is set to less than 1. I have the whisker length set to default, which is 1.5 times the interquartile range, but the other lower whiskers are much longer than that. Does anyone know why this might be happening?
Here is the code:
boxplot(Concentration, {Nutrient Source}, 'factorseparator',[1],'outliersize',[1],'symbol','ro','factorgap',[5 1]); %default whisker length
boxplot(Concentration, {Nutrient Source}, 'factorseparator',[1],'outliersize',[1],'symbol','ro','factorgap',[5 1],'whisker',[0.9]); %shorter whisker length
And here are the resulting boxplots:
0 Comments
Answers (1)
Star Strider
on 1 Jul 2019
You’re using a logarithmic y-axis scale. If the whiskers are negative, they won’t plot. They should appear with the default settings on a linear y-axis scale, although the rest of the plot may then be difficult to interpret.
2 Comments
Star Strider
on 1 Jul 2019
I forgot about zero values, since they are likewise not defined on a logarithmic scale.
- The whiskers are lines extending above and below each box. Whiskers are drawn from the ends of the interquartile ranges to the furthest observations within the whisker length (the adjacent values).
so perhaps you’re seeing the normal behaviour.
I don’t routinely use box plots, and haven’t in a while. When I’ve used them, they did what I wanted.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!