Skip to content

Commit

Permalink
Add informative error if invalid side is used for violin (#4612)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkrumbiegel authored Nov 24, 2024
1 parent 6d3f045 commit 63ccff6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/stats/violin.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function plot!(plot::Violin)

# Allow `side` to be either scalar or vector
sides = broadcast(x̂, vside) do _, s
return s === :left ? - 1 : s === :right ? 1 : 0
return s === :left ? - 1 : s === :right ? 1 : s === :both ? 0 : error("Invalid side $(repr(s)), only :left, :right or :both are allowed.")
end

sa = StructArray((x = x̂, side = sides))
Expand Down

0 comments on commit 63ccff6

Please sign in to comment.