From 1966e71375e0722f166c66c7f89f6539d368e6e2 Mon Sep 17 00:00:00 2001 From: Benoit Pasquier Date: Thu, 15 Apr 2021 10:30:01 +1000 Subject: [PATCH] Remove kwargs and add subplot test --- src/axes.jl | 16 ++++++++-------- test/test_axes.jl | 1 + 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/axes.jl b/src/axes.jl index 742af517..e418018d 100644 --- a/src/axes.jl +++ b/src/axes.jl @@ -236,14 +236,14 @@ function get_ticks(sp::Subplot, axis::Axis; update = true) end # Ticks getter functions -get_ticks(sp::Subplot, s::Symbol; kwargs...) = get_ticks(sp, sp[Symbol(s, :axis)]; kwargs...) -xticks(sp::Subplot; kwargs...) = get_ticks(sp, :x) -yticks(sp::Subplot; kwargs...) = get_ticks(sp, :y) -zticks(sp::Subplot; kwargs...) = get_ticks(sp, :z) -get_ticks(p::Plot, s::Symbol; kwargs...) = [get_ticks(sp, s; kwargs...) for sp in p.subplots] -xticks(p::Plot; kwargs...) = get_ticks(p, :x) -yticks(p::Plot; kwargs...) = get_ticks(p, :y) -zticks(p::Plot; kwargs...) = get_ticks(p, :z) +get_ticks(sp::Subplot, s::Symbol) = get_ticks(sp, sp[Symbol(s, :axis)]) +xticks(sp::Subplot) = get_ticks(sp, :x) +yticks(sp::Subplot) = get_ticks(sp, :y) +zticks(sp::Subplot) = get_ticks(sp, :z) +get_ticks(p::Plot, s::Symbol) = [get_ticks(sp, s) for sp in p.subplots] +xticks(p::Plot) = get_ticks(p, :x) +yticks(p::Plot) = get_ticks(p, :y) +zticks(p::Plot) = get_ticks(p, :z) export xticks, yticks, zticks function get_ticks(ticks::Symbol, cvals::T, dvals, args...) where T diff --git a/test/test_axes.jl b/test/test_axes.jl index 4de318d1..d981d21a 100644 --- a/test/test_axes.jl +++ b/test/test_axes.jl @@ -29,4 +29,5 @@ end p2 = plot(1:5, 1:5, 1:5, xticks=ticks2, yticks=ticks2, zticks=ticks2) p = plot(p1, p2) @test xticks(p) == yticks(p) == zticks(p) == [ticks1, ticks2] + @test xticks(p[1]) == yticks(p[1]) == zticks(p[1]) == ticks1 end