From 5395b418525b753028e2c8e52d9aed18090b7e96 Mon Sep 17 00:00:00 2001 From: Leon Wabeke Date: Wed, 22 Feb 2017 15:57:41 +0200 Subject: [PATCH 1/4] Attempt to add support for clims to plotly backend Added support for clims, seems to work on heatmap, surface and contour. On surface zlims be still be set to be different from clims. --- src/backends/plotly.jl | 6 ++++++ 1 file changed, 6 insertions(+) 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" From fd947ab8872727da7128063395802a7a990e7633 Mon Sep 17 00:00:00 2001 From: Josh Day Date: Wed, 22 Feb 2017 10:40:16 -0500 Subject: [PATCH 2/4] only one, smaller gr marker --- src/backends/gr.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 9472c0c5e5f0939ee33409de9369b46559900ad9 Mon Sep 17 00:00:00 2001 From: Tom Breloff Date: Fri, 24 Feb 2017 15:19:41 -0500 Subject: [PATCH 3/4] skip pyplot image test --- test/runtests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 24c27737c1b8ff816d394efe2f06c2d7c0512c54 Mon Sep 17 00:00:00 2001 From: "Michael K. Borregaard" Date: Sun, 26 Feb 2017 08:32:52 +0100 Subject: [PATCH 4/4] fix uneven bins --- src/recipes.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/recipes.jl b/src/recipes.jl index 156bda3e..0585e488 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 ()