Lower whisker and outliers not showing up on boxplot

8 visualizaciones (últimos 30 días)
Will McKettrick
Will McKettrick el 1 de Jul. de 2019
Comentada: Star Strider el 1 de Jul. de 2019
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:

Respuestas (1)

Star Strider
Star Strider el 1 de Jul. de 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 comentarios
Will McKettrick
Will McKettrick el 1 de Jul. de 2019
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?
Star Strider
Star Strider el 1 de Jul. de 2019
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.

Iniciar sesión para comentar.

Etiquetas

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by