diff --git a/src/args.jl b/src/args.jl index bfce812b..6197f26d 100644 --- a/src/args.jl +++ b/src/args.jl @@ -819,7 +819,7 @@ end function color_or_nothing!(d::KW, k::Symbol) v = d[k] - d[k] = if v == nothing + d[k] = if v == nothing || v == false colorscheme(RGBA(0,0,0,0)) else v diff --git a/src/axes.jl b/src/axes.jl index efe21a84..9ea0dbce 100644 --- a/src/axes.jl +++ b/src/axes.jl @@ -170,7 +170,14 @@ function expand_extrema!(sp::Subplot, d::KW) fr = 0.0 end if fr != nothing - expand_extrema!(sp.attr[vert ? :yaxis : :xaxis], fr) + axis = sp.attr[vert ? :yaxis : :xaxis] + if typeof(fr) <: Tuple + for fri in fr + expand_extrema!(axis, fri) + end + else + expand_extrema!(axis, fr) + end end # expand for bar_width diff --git a/src/plot.jl b/src/plot.jl index 7ae95c4e..7ffeeb0d 100644 --- a/src/plot.jl +++ b/src/plot.jl @@ -255,8 +255,7 @@ function _plot!(plt::Plot, d::KW, args...) # convert a ribbon into a fillrange if get(kw, :ribbon, nothing) != nothing - rib = kw[:ribbon] - kw[:fillrange] = (kw[:y] - rib, kw[:y] + rib) + make_fillrange_from_ribbon(kw) end # add the plot index diff --git a/src/series_args.jl b/src/series_args.jl index 29fc1b63..4cf070e5 100644 --- a/src/series_args.jl +++ b/src/series_args.jl @@ -62,9 +62,11 @@ function convertToAnyVector(v::AVec, d::KW) end end +convertToAnyVector(t::Tuple, d::KW) = Any[t], nothing + function convertToAnyVector(args...) - error("No recipes could handle the argument types: $(map(typeof, args[1:end-1]))") + error("In convertToAnyVector, could not handle the argument types: $(map(typeof, args[1:end-1]))") end # -------------------------------------------------------------------- diff --git a/src/utils.jl b/src/utils.jl index 458ce8cb..a48bfcc4 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -310,7 +310,23 @@ function ok(x::Number, y::Number, z::Number = 0) end ok(tup::Tuple) = ok(tup...) +# compute one side of a fill range from a ribbon +function make_fillrange_side(y, rib) + frs = zeros(length(y)) + for (i, (yi, ri)) in enumerate(zip(y, cycle(rib))) + frs[i] = yi + ri + end + frs +end +# turn a ribbon into a fillrange +function make_fillrange_from_ribbon(kw::KW) + y, rib = kw[:y], kw[:ribbon] + rib = wraptuple(rib) + rib1, rib2 = -first(rib), last(rib) + kw[:ribbon] = nothing + kw[:fillrange] = make_fillrange_side(y, rib1), make_fillrange_side(y, rib2) +end # ---------------------------------------------------------------