fix magic axis args for recipes
This commit is contained in:
parent
8594926b67
commit
e9ef5c852b
11
src/args.jl
11
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
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user