abline!

abline!(axis::Axis, a::Number, b::Number; line_kw_args...)              

Adds a line defined by f(x) = x * b + a to the axis. kwargs are the same as for a line plot and are passed directly to the line attributess.

The function abline! draws a linear function given slope and intercept values through the given Axis . The line always spans across the whole axis and doesn't affect the limits.

This function is not a plot type / recipe and only works with Axis .

using CairoMakie

fig, ax, pl = scatter(1:4)
abline!(ax, 0, 1)
abline!(ax, 0, 1.5, color = :red, linestyle=:dash, linewidth=2)
fig