From 4217a54f6b6f1e7636678eb4b33f3811ac0dcaac Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Tue, 26 May 2020 20:23:15 +0200 Subject: [PATCH] process showaxis --- src/args.jl | 3 ++- src/axes.jl | 3 +-- test/test_axes.jl | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) 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 75977ad4..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 @@ -61,7 +60,7 @@ function process_axis_arg!(plotattributes::AKW, arg, letter = "") elseif arg === nothing plotattributes[Symbol(letter,:ticks)] = [] - elseif T <: Bool || arg in _allShowaxisArgs || arg in _allShowaxisSyms + elseif T <: Bool || arg in _allShowaxisArgs plotattributes[Symbol(letter,:showaxis)] = showaxis(arg, letter) elseif typeof(arg) <: Number diff --git a/test/test_axes.jl b/test/test_axes.jl index 01c7ed00..52904b4a 100644 --- a/test/test_axes.jl +++ b/test/test_axes.jl @@ -2,4 +2,5 @@ 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