Merge pull request #306 from diegozea/dev

Solve a bug with whisker lengths (#210)
This commit is contained in:
Tom Breloff 2016-06-07 23:01:29 -04:00
commit d0ee402939

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
if Float64(range) != 0.0 # if the range is 0.0, the whiskers will extend to the data
limit = range*(q4-q2) limit = range*(q4-q2)
inside = Float64[]
for value in values for value in values
if (value < (q2 - limit)) || (value > (q4 + limit)) if (value < (q2 - limit)) || (value > (q4 + limit))
push!(outliers_y, value) push!(outliers_y, value)
push!(outliers_x, center) push!(outliers_x, center)
else
push!(inside, value)
end end
end end
# change q1 and q5 to use the limit in order to show outliers # change q1 and q5 to show outliers
q1 = q2 - limit # using maximum and minimum values inside the limits
q5 = q4 + limit q1, q5 = extrema(inside)
end
# Box # Box
xcoords = notch::Bool ? [ xcoords = notch::Bool ? [
m, l, r, m, m, NaN, # lower T m, l, r, m, m, NaN, # lower T