diff --git a/src/series.jl b/src/series.jl index 32300558d..a4d21d477 100644 --- a/src/series.jl +++ b/src/series.jl @@ -515,20 +515,24 @@ end # # special handling... xmin/xmax with parametric function(s) @recipe function f(f::Function, xmin::Number, xmax::Number) xscale, yscale = [get(plotattributes, sym, :identity) for sym=(:xscale,:yscale)] - xs = _scaled_adapted_grid(f, xscale, yscale, xmin, xmax) - xs, f + _scaled_adapted_grid(f, xscale, yscale, xmin, xmax) end @recipe function f(fs::AbstractArray{F}, xmin::Number, xmax::Number) where F<:Function xscale, yscale = [get(plotattributes, sym, :identity) for sym=(:xscale,:yscale)] - xs = Any[_scaled_adapted_grid(f, xscale, yscale, xmin, xmax) for f in fs] - xs, fs + xs = ys = Array{Any}(undef, length(fs)) + for (i, (x, y)) in enumerate(_scaled_adapted_grid(f, xscale, yscale, xmin, xmax) for f in fs) + xs[i] = x + ys[i] = y + end + xs, ys end @recipe f(fx::FuncOrFuncs{F}, fy::FuncOrFuncs{G}, u::AVec) where {F<:Function,G<:Function} = mapFuncOrFuncs(fx, u), mapFuncOrFuncs(fy, u) @recipe f(fx::FuncOrFuncs{F}, fy::FuncOrFuncs{G}, umin::Number, umax::Number, n = 200) where {F<:Function,G<:Function} = fx, fy, range(umin, stop = umax, length = n) function _scaled_adapted_grid(f, xscale, yscale, xmin, xmax) (xf, xinv), (yf, yinv) = ((scalefunc(s),invscalefunc(s)) for s in (xscale,yscale)) - xinv.(adapted_grid(yf∘f∘xinv, xf.((xmin, xmax)))) + xs, ys = adapted_grid(yf∘f∘xinv, xf.((xmin, xmax))) + xinv.(xs), yinv.(ys) end # diff --git a/test/runtests.jl b/test/runtests.jl index 24feab44c..55c7e9630 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -93,6 +93,7 @@ end for plt in plots display(plt) end + @test_nowarn plot(x->x^2,0,2) end @testset "EmptyAnim" begin