hlines! and vlines!

hlines!(ax::Axis, ys; xmin = 0.0, xmax = 1.0, attrs...)              

Create horizontal lines across ax at ys in data coordinates and xmin to xmax in axis coordinates (0 to 1). All three of these can have single or multiple values because they are broadcast to calculate the final line segments.

vlines!(ax::Axis, xs; ymin = 0.0, ymax = 1.0, attrs...)              

Create vertical lines across ax at xs in data coordinates and ymin to ymax in axis coordinates (0 to 1). All three of these can have single or multiple values because they are broadcast to calculate the final line segments.

These functions are not plot types / recipes and only work with Axis .

using CairoMakie

f = Figure()

ax1 = Axis(f[1, 1], title = "vlines")

lines!(ax1, 0..4pi, sin)
vlines!(ax1, [pi, 2pi, 3pi], color = :red)

ax2 = Axis(f[1, 2], title = "hlines")
hlines!(ax2, [1, 2, 3, 4], xmax = [0.25, 0.5, 0.75, 1], color = :blue)

f