pass correct xlims to adapted_grid

This commit is contained in:
daschw 2019-11-16 10:03:04 +01:00
parent c472ecf3b0
commit 2c78f1ff7b

View File

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