From 2c78f1ff7b540a4caa0b38fdaa038ff2227ed3fa Mon Sep 17 00:00:00 2001 From: daschw Date: Sat, 16 Nov 2019 10:03:04 +0100 Subject: [PATCH] pass correct xlims to adapted_grid --- src/series.jl | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/series.jl b/src/series.jl index 61da260f..9d63aaeb 100644 --- a/src/series.jl +++ b/src/series.jl @@ -379,12 +379,16 @@ end @recipe function f(f::FuncOrFuncs{F}) where F<:Function plt = plotattributes[:plot_object] - xmin, xmax = 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]))) + 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