Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
t-bltg committed Oct 13, 2024
1 parent 104e372 commit 66e38b6
Show file tree
Hide file tree
Showing 2 changed files with 288 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/StatsPlots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ using NaNMath

export @df, dataviewer

isvertical(plotattributes) = let val = get(plotattributes, :orientation, missing)
val === missing || val in (:vertical, :v)
end
isvertical(plotattributes) =
let val = get(plotattributes, :orientation, missing)
val === missing || val in (:vertical, :v)
end

include("df.jl")
include("interact.jl")
Expand Down
287 changes: 284 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -187,19 +187,300 @@ end

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

@testset "density" begin
rng = StableRNG(1337)
pl = density(rand(100_000), label="density(rand())")
pl = density(rand(100_000), label = "density(rand())")
@test show(devnull, pl) isa Nothing
end

@testset "boxplot" begin
# credits to stackoverflow.com/a/71467031
boxed = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 7, 26, 80, 170, 322, 486, 688, 817, 888, 849, 783, 732, 624, 500, 349, 232, 130, 49], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 28, 83, 181, 318, 491, 670, 761, 849, 843, 862, 799, 646, 481, 361, 225, 98, 50], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 8, 28, 80, 179, 322, 493, 660, 753, 803, 832, 823, 783, 657, 541, 367, 223, 121, 62], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 7, 23, 84, 171, 312, 463, 640, 778, 834, 820, 763, 752, 655, 518, 374, 244, 133, 52], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 21, 70, 169, 342, 527, 725, 808, 861, 857, 799, 688, 622, 523, 369, 232, 115, 41], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 9, 28, 76, 150, 301, 492, 660, 760, 823, 862, 790, 749, 646, 525, 352, 223, 116, 54], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 6, 21, 64, 165, 290, 434, 585, 771, 852, 847, 785, 739, 630, 535, 354, 230, 114, 42], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 4, 19, 76, 190, 337, 506, 680, 775, 851, 853, 816, 705, 588, 496, 388, 232, 127, 54]]
boxed = [
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
3,
7,
26,
80,
170,
322,
486,
688,
817,
888,
849,
783,
732,
624,
500,
349,
232,
130,
49,
],
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2,
28,
83,
181,
318,
491,
670,
761,
849,
843,
862,
799,
646,
481,
361,
225,
98,
50,
],
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2,
8,
28,
80,
179,
322,
493,
660,
753,
803,
832,
823,
783,
657,
541,
367,
223,
121,
62,
],
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
7,
23,
84,
171,
312,
463,
640,
778,
834,
820,
763,
752,
655,
518,
374,
244,
133,
52,
],
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
21,
70,
169,
342,
527,
725,
808,
861,
857,
799,
688,
622,
523,
369,
232,
115,
41,
],
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2,
9,
28,
76,
150,
301,
492,
660,
760,
823,
862,
790,
749,
646,
525,
352,
223,
116,
54,
],
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
6,
21,
64,
165,
290,
434,
585,
771,
852,
847,
785,
739,
630,
535,
354,
230,
114,
42,
],
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
2,
4,
19,
76,
190,
337,
506,
680,
775,
851,
853,
816,
705,
588,
496,
388,
232,
127,
54,
],
]

boxes = -0.002:0.0001:0.0012

Expand Down

0 comments on commit 66e38b6

Please sign in to comment.