From 39e10ffd83552e860b34e3d2ff90b58650f540a8 Mon Sep 17 00:00:00 2001 From: "Michael K. Borregaard" Date: Mon, 22 May 2017 22:49:20 +0200 Subject: [PATCH] Use NaNMath.extrema rather than Base.extrema To avoid returning NaN when there are NaNs in the Vector --- REQUIRE | 1 + src/Plots.jl | 1 + src/axes.jl | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/REQUIRE b/REQUIRE index 22f785ac..2f70e7f9 100644 --- a/REQUIRE +++ b/REQUIRE @@ -9,3 +9,4 @@ Measures Showoff StatsBase 0.14.0 JSON +NaNMath diff --git a/src/Plots.jl b/src/Plots.jl index 7e630ad7..19ba90dd 100644 --- a/src/Plots.jl +++ b/src/Plots.jl @@ -10,6 +10,7 @@ using Base.Meta @reexport using PlotThemes import Showoff import StatsBase +import NaNMath: extrema export grid, diff --git a/src/axes.jl b/src/axes.jl index a5882d9a..8d66278c 100644 --- a/src/axes.jl +++ b/src/axes.jl @@ -118,7 +118,7 @@ Base.show(io::IO, axis::Axis) = dumpdict(axis.d, "Axis", true) # Base.getindex(axis::Axis, k::Symbol) = getindex(axis.d, k) Base.setindex!(axis::Axis, v, ks::Symbol...) = setindex!(axis.d, v, ks...) Base.haskey(axis::Axis, k::Symbol) = haskey(axis.d, k) -Base.extrema(axis::Axis) = (ex = axis[:extrema]; (ex.emin, ex.emax)) +extrema(axis::Axis) = (ex = axis[:extrema]; (ex.emin, ex.emax)) #This is the NaNMath version, not the Base version const _scale_funcs = Dict{Symbol,Function}(