Skip to content

Commit

Permalink
add violin test
Browse files Browse the repository at this point in the history
  • Loading branch information
t-bltg committed Oct 13, 2024
1 parent 0e48362 commit 1ff9292
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/violin.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ get_quantiles(n::Int) = range(0, 1, length = n + 2)[2:(end - 1)]
)
# if only y is provided, then x will be UnitRange 1:size(y,2)
if typeof(x) <: AbstractRange
if step(x) == first(x) == 1
x = plotattributes[:series_plotindex]
x = if step(x) == first(x) == 1
plotattributes[:series_plotindex]
else
x = [getindex(x, plotattributes[:series_plotindex])]
[getindex(x, plotattributes[:series_plotindex])]
end
end
xsegs, ysegs = Segments(), Segments()
qxsegs, qysegs = Segments(), Segments()
mxsegs, mysegs = Segments(), Segments()
xsegs, ysegs = Plots.PlotsBase.Segments(), Plots.PlotsBase.Segments()
qxsegs, qysegs = Plots.PlotsBase.Segments(), Plots.PlotsBase.Segments()
mxsegs, mysegs = Plots.PlotsBase.Segments(), Plots.PlotsBase.Segments()
glabels = sort(collect(unique(x)))
bw = plotattributes[:bar_width]
bw == nothing && (bw = 0.8)
Expand Down
6 changes: 6 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,9 @@ end
pl = marginalscatter(rand(rng, 100), rand(rng, 100))
@test show(devnull, pl) isa Nothing
end

@testset "violin" begin
rng = StableRNG(1337)
pl = violin(repeat([.1, .2, .3], outer=100), randn(300), side=:right)
@test show(devnull, pl) isa Nothing
end

0 comments on commit 1ff9292

Please sign in to comment.