Skip to content

Commit

Permalink
include the actual fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ffreyer committed Dec 18, 2024
1 parent 6aff71d commit 79b7d93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/stats/violin.jl
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ function plot!(plot::Violin)
# interpolate median bounds between corresponding points
xm = spec.median
ip = Base.max(2, something(findfirst(>(xm), spec.kde.x), length(spec.kde.x)))
ym₋, ym₊ = spec.kde.density[ip], spec.kde.density[ip]
xm₋, xm₊ = spec.kde.x[ip], spec.kde.x[ip]
ym₋, ym₊ = spec.kde.density[Base.max(1, ip-1)], spec.kde.density[ip]
xm₋, xm₊ = spec.kde.x[Base.max(1, ip-1)], spec.kde.x[ip]
ym = (xm * (ym₊ - ym₋) + xm₊ * ym₋ - xm₋ * ym₊) / (xm₊ - xm₋)
median_left = point_func(spec.side == 1 ? spec.x : spec.x - ym * scale, xm)
median_right = point_func(spec.side == -1 ? spec.x : spec.x + ym * scale, xm)
Expand Down

0 comments on commit 79b7d93

Please sign in to comment.