diff --git a/src/examples.jl b/src/examples.jl index fabb368d..ed62e00e 100644 --- a/src/examples.jl +++ b/src/examples.jl @@ -145,7 +145,7 @@ PlotExample("Bar", PlotExample("Histogram", "", [:(begin - histogram(randn(1000), nbins=20) + histogram(randn(1000), bins = :scott, weights = repeat(1:5, outer = 200)) end)] ), diff --git a/src/recipes.jl b/src/recipes.jl index 97352505..8fb582ae 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -550,7 +550,7 @@ function _make_hist{N}(vs::NTuple{N,AbstractVector}, binning; normed = false, we edges = _hist_edges(vs, binning) h = float( weights == nothing ? StatsBase.fit(StatsBase.Histogram, vs, edges, closed = :left) : - StatsBase.fit(StatsBase.Histogram, vs, weights, edges, closed = :left) + StatsBase.fit(StatsBase.Histogram, vs, StatsBase.Weights(weights), edges, closed = :left) ) normalize!(h, mode = _hist_norm_mode(normed)) end