Lower whisker and outliers not showing up on boxplot

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:

답변 (1개)

Star Strider
Star Strider 2019년 7월 1일

0 개 추천

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

So I didn't have any negative values, but there was a zero, and removing it fixed the issue with the leftmost whisker. However, the lower whiskers are still extending to the lowest data point, rather than ending at 1.5 times the interquartile range. Any idea what could be causing that?
I forgot about zero values, since they are likewise not defined on a logarithmic scale.
I don’t, other than to note that the documentation on Box Plots mentions that:
  • 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.

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

카테고리

도움말 센터File Exchange에서 Data Distribution Plots에 대해 자세히 알아보기

제품

릴리스

R2018a

질문:

2019년 7월 1일

댓글:

2019년 7월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by