Merge pull request #1082 from timholy/teh/nbins

histogram: ensure the number of bins is finite
This commit is contained in:
Michael Krabbe Borregaard 2017-09-08 10:25:23 +02:00 committed by GitHub
commit 8412d77067
2 changed files with 4 additions and 1 deletions

View File

@ -501,7 +501,7 @@ wand_edges(x...) = (warn("Load the StatPlots package in order to use :wand bins.
function _auto_binning_nbins{N}(vs::NTuple{N,AbstractVector}, dim::Integer; mode::Symbol = :auto)
_cl(x) = ceil(Int, NaNMath.max(x, one(x)))
_iqr(v) = quantile(v, 0.75) - quantile(v, 0.25)
_iqr(v) = (q = quantile(v, 0.75) - quantile(v, 0.25); q > 0 ? q : oftype(q, 1))
_span(v) = ignorenan_maximum(v) - ignorenan_minimum(v)
n_samples = length(linearindices(first(vs)))

View File

@ -129,6 +129,9 @@ end
@test Plots.ignorenan_extrema(axis) == (0.5, 7.5)
end
@testset "NoFail" begin
histogram([1, 0, 0, 0, 0, 0])
end
# tests for preprocessing recipes