allow Function for fillrange and zcolor; fix fill kw

This commit is contained in:
Thomas Breloff 2016-02-09 19:22:05 -05:00
parent 5f8ecfa3fa
commit 3e49af9093
2 changed files with 17 additions and 2 deletions

View File

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

View File

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