diff --git a/src/backends/glvisualize.jl b/src/backends/glvisualize.jl index e91005ce..c09fcab0 100644 --- a/src/backends/glvisualize.jl +++ b/src/backends/glvisualize.jl @@ -1382,7 +1382,7 @@ function label_scatter(d, w, ho) if isapprox(bbw[3], 0) bbw = Vec3f0(bbw[1], bbw[2], 1) end - mini = NaNMath.minimum(bb) + mini = minimum(bb) m = GLAbstraction.translationmatrix(-mini) m *= GLAbstraction.scalematrix(1 ./ bbw) kw[:primitive] = m * p diff --git a/src/backends/gr.jl b/src/backends/gr.jl index 919eb02d..6cc85756 100644 --- a/src/backends/gr.jl +++ b/src/backends/gr.jl @@ -341,7 +341,7 @@ end function gr_set_line(lw, style, c) #, a) GR.setlinetype(gr_linetype[style]) w, h = gr_plot_size - GR.setlinewidth(NaNMath.max(0, lw / ((w + h) * 0.001))) + GR.setlinewidth(max(0, lw / ((w + h) * 0.001))) gr_set_linecolor(c) #, a) end @@ -394,7 +394,7 @@ function gr_viewport_from_bbox(sp::Subplot{GRBackend}, bb::BoundingBox, w, h, vi viewport[4] = viewport_canvas[4] * (1.0 - top(bb) / h) if is3d(sp) vp = viewport[:] - extent = NaNMath.min(vp[2] - vp[1], vp[4] - vp[3]) + extent = min(vp[2] - vp[1], vp[4] - vp[3]) viewport[1] = 0.5 * (vp[1] + vp[2] - extent) viewport[2] = 0.5 * (vp[1] + vp[2] + extent) viewport[3] = 0.5 * (vp[3] + vp[4] - extent) @@ -824,7 +824,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas) # create the colorbar of contour levels if sp[:colorbar] != :none gr_set_viewport_cmap(sp) - l = round(Int32, 1000 + (h - NaNMath.minimum(h)) / (NaNMath.maximum(h) - NaNMath.minimum(h)) * 255) #much in doubt whether to use the NaNMath minimum here + l = round(Int32, 1000 + (h - NaNMath.minimum(h)) / (NaNMath.maximum(h) - NaNMath.minimum(h)) * 255) GR.setwindow(xmin, xmax, zmin, zmax) GR.cellarray(xmin, xmax, zmax, zmin, 1, length(l), l) ztick = 0.5 * GR.tick(zmin, zmax) diff --git a/src/backends/pyplot.jl b/src/backends/pyplot.jl index 1aff8091..49760a75 100644 --- a/src/backends/pyplot.jl +++ b/src/backends/pyplot.jl @@ -705,11 +705,11 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series) # contours on the axis planes if series[:contours] for (zdir,mat) in (("x",x), ("y",y), ("z",z)) - offset = (zdir == "y" ? _maximum : _minimum)(mat) + offset = (zdir == "y" ? NaNMath.maximum : NaNMath.minimum)(mat) handle = ax[:contourf](x, y, z, levelargs...; zdir = zdir, cmap = py_fillcolormap(series), - offset = (zdir == "y" ? _maximum : _minimum)(mat) # where to draw the contour plane + offset = (zdir == "y" ? NaNMath.maximum : NaNMath.minimum)(mat) # where to draw the contour plane ) push!(handles, handle) needs_colorbar = true @@ -1096,10 +1096,10 @@ function _update_min_padding!(sp::Subplot{PyPlotBackend}) bottompad = 0mm for bb in (py_bbox_axis(ax, "x"), py_bbox_axis(ax, "y"), py_bbox_title(ax)) if ispositive(width(bb)) && ispositive(height(bb)) - leftpad = NaNMath.max(leftpad, left(plotbb) - left(bb)) - toppad = NaNMath.max(toppad, top(plotbb) - top(bb)) - rightpad = NaNMath.max(rightpad, right(bb) - right(plotbb)) - bottompad = NaNMath.max(bottompad, bottom(bb) - bottom(plotbb)) + leftpad = max(leftpad, left(plotbb) - left(bb)) + toppad = max(toppad, top(plotbb) - top(bb)) + rightpad = max(rightpad, right(bb) - right(plotbb)) + bottompad = max(bottompad, bottom(bb) - bottom(plotbb)) end end diff --git a/src/components.jl b/src/components.jl index da41ed55..4a11bd7e 100644 --- a/src/components.jl +++ b/src/components.jl @@ -646,7 +646,7 @@ function (bc::BezierCurve)(t::Real) end # mean(x::Real, y::Real) = 0.5*(x+y) #commented out as I cannot see this used anywhere and it overwrites a Base method with different functionality -NaNMath.mean{N,T<:Real}(ps::FixedSizeArrays.Vec{N,T}...) = NaNMath.sum(ps) / length(ps) +# mean{N,T<:Real}(ps::FixedSizeArrays.Vec{N,T}...) = sum(ps) / length(ps) # I also could not see this used anywhere, and it's type piracy - implementing a NaNMath version for this would just involve converting to a standard array @deprecate curve_points coords diff --git a/src/layouts.jl b/src/layouts.jl index 6a380b1f..003c63c1 100644 --- a/src/layouts.jl +++ b/src/layouts.jl @@ -55,10 +55,10 @@ function Base.:+(bb1::BoundingBox, bb2::BoundingBox) ispositive(width(bb2)) || return bb1 ispositive(height(bb2)) || return bb1 - l = NaNMath.min(left(bb1), left(bb2)) - t = NaNMath.min(top(bb1), top(bb2)) - r = NaNMath.max(right(bb1), right(bb2)) - b = NaNMath.max(bottom(bb1), bottom(bb2)) + l = min(left(bb1), left(bb2)) + t = min(top(bb1), top(bb2)) + r = max(right(bb1), right(bb2)) + b = max(bottom(bb1), bottom(bb2)) BoundingBox(l, t, r-l, b-t) end diff --git a/src/recipes.jl b/src/recipes.jl index 1cf01b05..11883022 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -548,7 +548,7 @@ Plots.@deps stepbins path function _auto_binning_nbins{N}(vs::NTuple{N,AbstractVector}, dim::Integer; mode::Symbol = :auto) - _cl(x) = NaNMath.max(ceil(Int, x), 1) + _cl(x) = max(ceil(Int, x), 1) _iqr(v) = quantile(v, 0.75) - quantile(v, 0.25) _span(v) = NaNMath.maximum(v) - NaNMath.minimum(v) diff --git a/src/utils.jl b/src/utils.jl index 0ad5194a..dddfdf19 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -6,7 +6,7 @@ function binData(data, nbins) lo, hi = NaNMath.extrema(data) edges = collect(linspace(lo, hi, nbins+1)) midpoints = calcMidpoints(edges) - buckets = Int[NaNMath.max(2, NaNMath.min(searchsortedfirst(edges, x), length(edges)))-1 for x in data] + buckets = Int[max(2, min(searchsortedfirst(edges, x), length(edges)))-1 for x in data] counts = zeros(Int, length(midpoints)) for b in buckets counts[b] += 1