diff --git a/src/arg_desc.jl b/src/arg_desc.jl index 3bf2da5f..c8224d01 100644 --- a/src/arg_desc.jl +++ b/src/arg_desc.jl @@ -141,6 +141,7 @@ const _arg_desc = KW( NTuple{2,Number} or Symbol. Force axis limits. Only finite values are used (you can set only the right limit with `xlims = (-Inf, 2)` for example). `:round` widens the limit to the nearest round number ie. [0.1,3.6]=>[0.0,4.0] `:symmetric` sets the limits to be symmetric around zero. + Additionally pass `widen=false` to use the specified limits exactly. """, :ticks => "Vector of numbers (set the tick values), Tuple of (tickvalues, ticklabels), or `:auto`", :scale => "Symbol. Scale of the axis: `:none`, `:ln`, `:log2`, `:log10`", diff --git a/src/axes.jl b/src/axes.jl index c7a844ef..3487a98f 100644 --- a/src/axes.jl +++ b/src/axes.jl @@ -504,17 +504,14 @@ end const _widen_seriestypes = (:line, :path, :steppre, :stepmid, :steppost, :sticks, :scatter, :barbins, :barhist, :histogram, :scatterbins, :scatterhist, :stepbins, :stephist, :bins2d, :histogram2d, :bar, :shape, :path3d, :scatter3d) function default_should_widen(axis::Axis) - should_widen = false - if !(is_2tuple(axis[:lims]) || axis[:lims] == :round) - for sp in axis.sps - for series in series_list(sp) - if series.plotattributes[:seriestype] in _widen_seriestypes - should_widen = true - end + for sp in axis.sps + for series in series_list(sp) + if series.plotattributes[:seriestype] in _widen_seriestypes + return true end end end - should_widen + false end function round_limits(amin,amax)