diff --git a/src/backends/gr.jl b/src/backends/gr.jl index f79258ab..c17df76e 100644 --- a/src/backends/gr.jl +++ b/src/backends/gr.jl @@ -1017,7 +1017,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas) end if series[:markershape] != :none - gr_draw_markers(series, xpos-[0.06,0.02], [ypos,ypos], 10, nothing) + gr_draw_markers(series, xpos - .035, ypos, 6, nothing) end if typeof(series[:label]) <: Array diff --git a/src/backends/plotly.jl b/src/backends/plotly.jl index bbdd29b9..85c69105 100644 --- a/src/backends/plotly.jl +++ b/src/backends/plotly.jl @@ -31,6 +31,7 @@ const _plotly_attr = merge_with_base_supported([ :hover, :inset_subplots, :bar_width, + :clims, ]) const _plotly_seriestype = [ @@ -438,6 +439,11 @@ function plotly_series(plt::Plot, series::Series) end end + clims = sp[:clims] + if is_2tuple(clims) + d_out[:zmin], d_out[:zmax] = clims + end + # set the "type" if st in (:path, :scatter, :scattergl) d_out[:type] = st==:scattergl ? "scattergl" : "scatter" diff --git a/src/recipes.jl b/src/recipes.jl index 152752a3..c4bf60c4 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -410,6 +410,8 @@ function my_hist(v, bins; normed = false, weights = nothing) counts[idx] += (weights == nothing ? 1.0 : weights[i]) end + counts = isapprox(extrema(diff(edges))...) ? counts : counts ./ diff(edges) # for uneven bins, normalize to area. + # normalize by bar area? norm_denom = normed ? sum(diff(edges) .* counts) : 1.0 if norm_denom == 0 @@ -424,7 +426,8 @@ end edges, counts = my_hist(y, d[:bins], normed = d[:normalize], weights = d[:weights]) - x := edges + bar_width := diff(edges) + x := centers(edges) y := counts seriestype := :bar () diff --git a/test/runtests.jl b/test/runtests.jl index ca7f5e3e..953ad8fe 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -23,7 +23,7 @@ facts("PyPlot") do @fact pyplot() --> Plots.PyPlotBackend() @fact backend() --> Plots.PyPlotBackend() - image_comparison_facts(:pyplot, skip=[25,30], eps=img_eps) + image_comparison_facts(:pyplot, skip=[6,25,30], eps=img_eps) end facts("GR") do