From e9ef5c852b8841e3a4dca4507dea4dac573ead85 Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Fri, 27 Mar 2020 17:09:07 +0100 Subject: [PATCH] fix magic axis args for recipes --- src/args.jl | 11 ++++++++--- src/series.jl | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/args.jl b/src/args.jl index a2b70326..cebc5344 100644 --- a/src/args.jl +++ b/src/args.jl @@ -466,12 +466,17 @@ const _magic_axis_args = [:axis, :tickfont, :guidefont] const _magic_subplot_args = [:titlefont, :legendfont, :legendtitlefont, ] const _magic_series_args = [:line, :marker, :fill] -function is_default_attribute(k::Symbol) +function is_noletter_attribute(k) + is_axis_attr_noletter(k) && return true + k in _magic_axis_args && return true + return false +end + +function is_default_attribute(k) k in _internal_args && return true k in _all_args && return true is_axis_attr(k) && return true - is_axis_attr_noletter(k) && return true - k in _magic_axis_args && return true + is_noletter_attribute(k) && return true k in _magic_subplot_args && return true k in _magic_series_args && return true Symbol(chop(string(k); head = 1, tail = 0)) in _magic_axis_args && return true diff --git a/src/series.jl b/src/series.jl index 5df68409..43cedc8b 100644 --- a/src/series.jl +++ b/src/series.jl @@ -231,7 +231,7 @@ _apply_type_recipe(plotattributes, v::AbstractArray{<:DataPoint}, letter) = v # axis args before type recipes should still be mapped to all axes function _preprocess_axis_args!(plotattributes) for (k, v) in plotattributes - if haskey(_axis_defaults, k) + if is_noletter_attribute(k) pop!(plotattributes, k) for l in (:x, :y, :z) lk = Symbol(l, k) @@ -250,7 +250,7 @@ function _postprocess_axis_args!(plotattributes, letter) pop!(plotattributes, :letter) if letter in (:x, :y, :z) for (k, v) in plotattributes - if haskey(_axis_defaults, k) + if is_noletter_attribute(k) pop!(plotattributes, k) lk = Symbol(letter, k) haskey(plotattributes, lk) || (plotattributes[lk] = v)