hspan! and vspan!

hspan!(ax::Axis, y_lows, y_highs; xmin = 0.0, xmax = 1.0, attrs...)              

Create horizontal spans across ax from y_lows to y_highs in data coordinates and xmin to xmax in axis coordinates (0 to 1 by default). All four of these can have single or multiple values because they are broadcast to calculate the final spans.

vspan!(ax::Axis, x_lows, x_highs; ymin = 0.0, ymax = 1.0, attrs...)              

Create vertical spans across ax from x_lows to x_highs in data coordinates and ymin to ymax in axis coordinates (0 to 1 by default). All four of these can have single or multiple values because they are broadcast to calculate the final spans.

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

using CairoMakie

f = Figure()
ax = Axis(f[1, 1])

lines!(ax, 0..20, sin)
vspan!(ax, [0, 2pi, 4pi], [pi, 3pi, 5pi], color = (:red, 0.2))
hspan!(ax, -1.1, -0.9, color = (:blue, 0.2))

f