Skip to content

Commit

Permalink
restore v0.4 behavior on v0.5, fixes #880
Browse files Browse the repository at this point in the history
add test for histogram with density=true
  • Loading branch information
tlnagy committed Aug 24, 2016
1 parent 4a36837 commit f3ba121
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/statistics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ function apply_statistic(stat::HistogramStatistic,
x_min = Gadfly.concrete_minimum(values)
span = x_max - x_min
binwidth = span / d
bincounts ./= sum(bincounts) * binwidth
bincounts = bincounts ./ sum(bincounts) * binwidth
end

binwidth = (x_max - x_min) / d
Expand Down
5 changes: 5 additions & 0 deletions test/histogram_density.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
using Gadfly, RDatasets

# see issue #880
plot(dataset("ggplot2", "diamonds"), x="Price", color="Cut",
Geom.histogram(bincount=30, density=true))

0 comments on commit f3ba121

Please sign in to comment.