diff --git a/src/backends/plotly.jl b/src/backends/plotly.jl index 9d7126b0..eda984c9 100644 --- a/src/backends/plotly.jl +++ b/src/backends/plotly.jl @@ -669,6 +669,8 @@ function plotly_series_shapes(plt::Plot, series::Series) d_outs[i] = d_out end if series[:fill_z] != nothing + push!(d_outs, plotly_colorbar_hack(series, base_d, :fill)) + elseif series[:line_z] != nothing push!(d_outs, plotly_colorbar_hack(series, base_d, :line)) end d_outs diff --git a/src/recipes.jl b/src/recipes.jl index 82efc3fa..611c8407 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -407,7 +407,7 @@ end end ensure_gradient!(plotattributes, :fillcolor, :fillalpha) fill_z := fz - line_z --> fz + line_z := fz x := x_pts y := y_pts z := nothing diff --git a/src/utils.jl b/src/utils.jl index 80d5487f..b9ab6705 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -643,17 +643,12 @@ end function get_fillcolor(series, i::Int = 1) fc = series[:fillcolor] fz = series[:fill_z] - lz = series[:line_z] - if fz == nothing && lz == nothing + if fz == nothing isa(fc, ColorGradient) ? fc : _cycle(fc, i) else cmin, cmax = get_clims(series[:subplot]) grad = isa(fc, ColorGradient) ? fc : cgrad() - if fz != nothing - grad[clamp((_cycle(fz, i) - cmin) / (cmax - cmin), 0, 1)] - elseif lz != nothing - grad[clamp((_cycle(lz, i) - cmin) / (cmax - cmin), 0, 1)] - end + grad[clamp((_cycle(fz, i) - cmin) / (cmax - cmin), 0, 1)] end end