From f554bf925e80055a2de8f60d4b71fc791bd85f52 Mon Sep 17 00:00:00 2001 From: Thomas Breloff Date: Thu, 5 Jan 2017 10:18:47 -0700 Subject: [PATCH] try catch for func recipe, move adapted_grid to f,xmin,xmax recipe; closes #610; closes #621 --- src/series.jl | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/series.jl b/src/series.jl index bf8144d8..69a36ea8 100644 --- a/src/series.jl +++ b/src/series.jl @@ -343,9 +343,12 @@ end @recipe function f(f::FuncOrFuncs) plt = d[:plot_object] - xmin, xmax = axis_limits(plt[1][:xaxis]) - xs = adapted_grid(f, (xmin, xmax)) - xs, f + xmin, xmax = try + axis_limits(plt[1][:xaxis]) + catch + -5, 5 + end + f, xmin, xmax end # @@ -417,7 +420,10 @@ end # # # special handling... xmin/xmax with parametric function(s) -@recipe f(f::FuncOrFuncs, xmin::Number, xmax::Number) = linspace(xmin, xmax, 100), f +@recipe function f(f::FuncOrFuncs, xmin::Number, xmax::Number) + xs = adapted_grid(f, (xmin, xmax)) + xs, f +end @recipe f(fx::FuncOrFuncs, fy::FuncOrFuncs, u::AVec) = mapFuncOrFuncs(fx, u), mapFuncOrFuncs(fy, u) @recipe f(fx::FuncOrFuncs, fy::FuncOrFuncs, umin::Number, umax::Number, n = 200) = fx, fy, linspace(umin, umax, n)