Merge pull request #1327 from mkborregaard/master

Don't return false from abline!
This commit is contained in:
Michael Krabbe Borregaard 2017-12-18 09:20:36 +01:00 committed by GitHub
commit 6d88e150d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -989,7 +989,11 @@ end
function abline!(plt::Plot, a, b; kw...)
xl, yl = xlims(plt), ylims(plt)
x1, x2 = max(xl[1], (yl[1] - b)/a), min(xl[2], (yl[2] - b)/a)
x2 > x1 && plot!(plt, x -> b + a*x, x1, x2; kw...)
if x2 > x1
plot!(plt, x -> b + a*x, x1, x2; kw...)
else
nothing
end
end
abline!(args...; kw...) = abline!(current(), args...; kw...)