From 4c9dd440aa1d0c329e245bf2b84e3fb44f29fa76 Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Tue, 26 May 2020 20:40:44 +0200 Subject: [PATCH] Fix showaxis (#2733) * also replace axis syms * include test_axes [skip ci] * Create test_axes.jl * process showaxis --- src/args.jl | 3 ++- src/axes.jl | 1 - test/runtests.jl | 1 + test/test_axes.jl | 6 ++++++ 4 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 test/test_axes.jl diff --git a/src/args.jl b/src/args.jl index da028e21..536f9691 100644 --- a/src/args.jl +++ b/src/args.jl @@ -946,7 +946,8 @@ function RecipesPipeline.preprocess_attributes!(plotattributes::AKW) # handle axis args common to all axis args = RecipesPipeline.pop_kw!(plotattributes, :axis, ()) - for arg in wraptuple(args) + showarg = wraptuple(RecipesPipeline.pop_kw!(plotattributes, :showaxis, ())) + for arg in wraptuple((args..., showarg...)) for letter in (:x, :y, :z) process_axis_arg!(plotattributes, arg, letter) end diff --git a/src/axes.jl b/src/axes.jl index 0979186a..c4883a1f 100644 --- a/src/axes.jl +++ b/src/axes.jl @@ -35,7 +35,6 @@ end function process_axis_arg!(plotattributes::AKW, arg, letter = "") T = typeof(arg) arg = get(_scaleAliases, arg, arg) - if typeof(arg) <: Font plotattributes[Symbol(letter,:tickfont)] = arg plotattributes[Symbol(letter,:guidefont)] = arg diff --git a/test/runtests.jl b/test/runtests.jl index a6a88b31..696e147e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -9,6 +9,7 @@ using LibGit2 using GeometryTypes using Dates +include("test_axes.jl") include("test_hdf5plots.jl") include("test_pgfplotsx.jl") diff --git a/test/test_axes.jl b/test/test_axes.jl new file mode 100644 index 00000000..52904b4a --- /dev/null +++ b/test/test_axes.jl @@ -0,0 +1,6 @@ +using Plots, Test + +@testset "Showaxis" begin + @test plot(1:5, showaxis = :y)[1][:yaxis][:showaxis] == true + @test plot(1:5, showaxis = :y)[1][:xaxis][:showaxis] == false +end