allow Function for fillrange and zcolor; fix fill kw
This commit is contained in:
parent
5f8ecfa3fa
commit
3e49af9093
11
src/args.jl
11
src/args.jl
@ -493,7 +493,16 @@ function processFillArg(d::Dict, arg)
|
||||
arg.color == nothing || (d[:fillcolor] = arg.color == :auto ? :auto : colorscheme(arg.color))
|
||||
arg.alpha == nothing || (d[:fillalpha] = arg.alpha)
|
||||
|
||||
# fillrange function
|
||||
elseif trueOrAllTrue(a -> isa(a, Function), arg)
|
||||
d[:fillrange] = arg
|
||||
|
||||
# fillalpha
|
||||
elseif trueOrAllTrue(a -> typeof(a) <: Real && a > 0 && a < 1, arg)
|
||||
d[:fillalpha] = arg
|
||||
|
||||
elseif !handleColors!(d, arg, :fillcolor)
|
||||
|
||||
d[:fillrange] = arg
|
||||
end
|
||||
end
|
||||
@ -746,8 +755,6 @@ function getSeriesArgs(pkg::PlottingPackage, plotargs::Dict, kw, commandIndex::I
|
||||
c = (c == :match ? d[:linecolor] : getSeriesRGBColor(c, plotargs, plotIndex))
|
||||
d[:fillcolor] = c
|
||||
|
||||
# TODO: rebuild
|
||||
|
||||
# set label
|
||||
label = d[:label]
|
||||
label = (label == "AUTO" ? "y$globalIndex" : label)
|
||||
|
||||
@ -321,6 +321,14 @@ function createKWargsList(plt::PlottingObject, x, y; kw...)
|
||||
d[:linetype] = :path
|
||||
end
|
||||
|
||||
# map functions to vectors
|
||||
if isa(d[:zcolor], Function)
|
||||
d[:zcolor] = map(d[:zcolor], d[:x])
|
||||
end
|
||||
if isa(d[:fillrange], Function)
|
||||
d[:fillrange] = map(d[:fillrange], d[:x])
|
||||
end
|
||||
|
||||
# cleanup those fields that were used only for generating kw args
|
||||
for k in (:idxfilter, :numUncounted, :dataframe)
|
||||
delete!(d, k)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user