Merge pull request #2258 from daschw/function_xlims

pass correct xlims to adapted_grid
This commit is contained in:
Daniel Schwabeneder 2019-11-16 10:33:30 +01:00 committed by GitHub
commit db02ffa436
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -379,13 +379,17 @@ end
@recipe function f(f::FuncOrFuncs{F}) where F<:Function
plt = plotattributes[:plot_object]
xmin, xmax = try
xmin, xmax = if haskey(plotattributes, :xlims)
plotattributes[:xlims]
else
try
axis_limits(plt[1], :x)
catch
xinv = invscalefunc(get(plotattributes, :xscale, :identity))
xm = tryrange(f, xinv.([-5,-1,0,0.01]))
xm, tryrange(f, filter(x->x>xm, xinv.([5,1,0.99, 0, -0.01])))
end
end
f, xmin, xmax
end