process showaxis

This commit is contained in:
Simon Christ 2020-05-26 20:23:15 +02:00
parent 209cf66acc
commit 4217a54f6b
3 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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