Solve a bug with whisker lengths (#210)

This commit is contained in:
Diego Javier Zea 2016-06-07 23:44:41 -03:00
parent cf4fcf3351
commit 2d095daddc

View File

@ -483,16 +483,21 @@ notch_width(q2, q4, N) = 1.58 * (q4-q2)/sqrt(N)
# internal nodes for notches # internal nodes for notches
L, R = center - 0.5 * _box_halfwidth, center + 0.5 * _box_halfwidth L, R = center - 0.5 * _box_halfwidth, center + 0.5 * _box_halfwidth
# outliers # outliers
limit = range*(q4-q2) if Float64(range) != 0.0 # if the range is 0.0, the whiskers will extend to the data
for value in values limit = range*(q4-q2)
if (value < (q2 - limit)) || (value > (q4 + limit)) inside = Float64[]
push!(outliers_y, value) for value in values
push!(outliers_x, center) if (value < (q2 - limit)) || (value > (q4 + limit))
push!(outliers_y, value)
push!(outliers_x, center)
else
push!(inside, value)
end
end end
# change q1 and q5 to show outliers
# using maximum and minimum values inside the limits
q1, q5 = extrema(inside)
end end
# change q1 and q5 to use the limit in order to show outliers
q1 = q2 - limit
q5 = q4 + limit
# Box # Box
xcoords = notch::Bool ? [ xcoords = notch::Bool ? [
m, l, r, m, m, NaN, # lower T m, l, r, m, m, NaN, # lower T