Skip to content

Commit 837514f

Browse files
authored
fix widen removal (#520)
1 parent b8f99a1 commit 837514f

File tree

4 files changed

+40
-7
lines changed

4 files changed

+40
-7
lines changed

.github/workflows/CI.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
name: CI
2+
23
on:
34
push:
4-
branches:
5-
- master
5+
branches: [master]
66
pull_request:
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
10+
cancel-in-progress: true
11+
712
jobs:
813
test:
14+
env:
15+
GKS_ENCODING: "utf8"
16+
GKSwstype: "nul"
917
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
1018
runs-on: ${{ matrix.os }}
1119
continue-on-error: ${{ matrix.version == 'nightly' }}

src/marginalhist.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@
77
bns = get(plotattributes, :bins, :auto)
88
scale = get(plotattributes, :scale, :identity)
99
edges1, edges2 = Plots._hist_edges((x, y), bns)
10-
xlims, ylims = Plots.widen(Plots.ignorenan_extrema(x)..., scale),
11-
Plots.widen(Plots.ignorenan_extrema(y)..., scale)
10+
xlims, ylims = map(
11+
x -> Plots.scale_lims(
12+
Plots.ignorenan_extrema(x)...,
13+
Plots.default_widen_factor,
14+
scale,
15+
),
16+
(x, y),
17+
)
1218

1319
# set up the subplots
1420
legend --> false

src/marginalscatter.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@
55
i = isfinite.(x) .& isfinite.(y)
66
x, y = x[i], y[i]
77
scale = get(plotattributes, :scale, :identity)
8-
xlims, ylims = Plots.widen(Plots.ignorenan_extrema(x)..., scale),
9-
Plots.widen(Plots.ignorenan_extrema(y)..., scale)
8+
xlims, ylims = map(
9+
x -> Plots.scale_lims(
10+
Plots.ignorenan_extrema(x)...,
11+
Plots.default_widen_factor,
12+
scale,
13+
),
14+
(x, y),
15+
)
1016

1117
# set up the subplots
1218
legend --> false

test/runtests.jl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,10 @@ end
141141
end
142142

143143
@testset "errorline" begin
144+
rng = StableRNG(1337)
144145
x = 1:10
145146
# Test for floats
146-
y = rand(10, 100) .* collect(1:2:20)
147+
y = rand(rng, 10, 100) .* collect(1:2:20)
147148
@test errorline(1:10, y)[1][1][:x] == x # x-input
148149
@test all(
149150
round.(errorline(1:10, y)[1][1][:y], digits = 3) .==
@@ -161,3 +162,15 @@ end
161162
round.(std(y, dims = 2), digits = 3),
162163
)
163164
end
165+
166+
@testset "marginalhist" begin
167+
rng = StableRNG(1337)
168+
pl = marginalhist(rand(rng, 100), rand(rng, 100))
169+
@test show(devnull, pl) isa Nothing
170+
end
171+
172+
@testset "marginalscatter" begin
173+
rng = StableRNG(1337)
174+
pl = marginalscatter(rand(rng, 100), rand(rng, 100))
175+
@test show(devnull, pl) isa Nothing
176+
end

0 commit comments

Comments
 (0)