try catch for func recipe, move adapted_grid to f,xmin,xmax recipe; closes #610; closes #621

This commit is contained in:
Thomas Breloff 2017-01-05 10:18:47 -07:00
parent 9676309ba2
commit f554bf925e

View File

@ -343,9 +343,12 @@ end
@recipe function f(f::FuncOrFuncs) @recipe function f(f::FuncOrFuncs)
plt = d[:plot_object] plt = d[:plot_object]
xmin, xmax = axis_limits(plt[1][:xaxis]) xmin, xmax = try
xs = adapted_grid(f, (xmin, xmax)) axis_limits(plt[1][:xaxis])
xs, f catch
-5, 5
end
f, xmin, xmax
end end
# #
@ -417,7 +420,10 @@ end
# #
# # special handling... xmin/xmax with parametric function(s) # # 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, 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) @recipe f(fx::FuncOrFuncs, fy::FuncOrFuncs, umin::Number, umax::Number, n = 200) = fx, fy, linspace(umin, umax, n)