diff --git a/src/common.jl b/src/common.jl index ba400d3e..0e1618e2 100644 --- a/src/common.jl +++ b/src/common.jl @@ -439,11 +439,10 @@ extend_limits(vec, lims) = extend_limits(vec, lims, :identity) unitless(x) = x # noop when Unitful is not loaded function extend_limits(vec::AbstractVector, lims, scale::Union{Symbol,Function}) - isempty(vec) && return is_auto(lims) ? autolims(lims) : lims - scale = scale_callback(scale) mi, ma = as_float(extrema(lims)) if iszero(mi) && iszero(ma) + isempty(vec) && return is_auto(lims) ? autolims(lims) : lims mi, ma = as_float(extrema(vec)) end if mi == ma diff --git a/test/tst_common.jl b/test/tst_common.jl index ca65ddc0..e9289782 100644 --- a/test/tst_common.jl +++ b/test/tst_common.jl @@ -36,7 +36,7 @@ end @test UnicodePlots.extend_limits([1, 2, 3, 4], [0, 0]) ≡ (1.0, 4.0) @test UnicodePlots.extend_limits([1, 2, 3, 4], [1, 1]) ≡ (0.0, 2.0) - @test UnicodePlots.extend_limits([], (-1, 2)) ≡ (-1, 2) + @test UnicodePlots.extend_limits([], (-1, 2)) ≡ (-1.0, 2.0) @test UnicodePlots.is_auto((0, 0)) @test UnicodePlots.is_auto([0, 0]) diff --git a/test/tst_io.jl b/test/tst_io.jl index b3bbd26a..54766293 100644 --- a/test/tst_io.jl +++ b/test/tst_io.jl @@ -82,7 +82,7 @@ end end @testset "Term extension" begin - gridplot(map(i -> lineplot((-i):i), 1:5); show_placeholder = true) |> display - gridplot(map(i -> lineplot((-i):i), 1:3); layout = (2, nothing)) |> display - gridplot(map(i -> lineplot((-i):i), 1:3); layout = (nothing, 1)) |> display + show(devnull, gridplot(map(i -> lineplot((-i):i), 1:5); show_placeholder = true)) + show(devnull, gridplot(map(i -> lineplot((-i):i), 1:3); layout = (2, nothing))) + show(devnull, gridplot(map(i -> lineplot((-i):i), 1:3); layout = (nothing, 1))) end