Don't add abline! if outside plot window
This commit is contained in:
parent
09c5e8a375
commit
6ff4dce62a
@ -989,7 +989,7 @@ 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)
|
||||
plot!(plt, x -> b + a*x, x1, x2; kw...)
|
||||
x2 > x1 && plot!(plt, x -> b + a*x, x1, x2; kw...)
|
||||
end
|
||||
|
||||
abline!(args...; kw...) = abline!(current(), args...; kw...)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user