Stream: helpdesk (published)

Topic: Makie vspans with time axis


view this post on Zulip dzɔn (May 16 2025 at 09:22):

Does anyone know how one could use vspan with an x time axis?

The closest I can get is by converting the time data into unix (integer) and plotting that, but then converting it into xticks seems impossible to do with time axes (and I also want the time axis to adapt when zooming in)

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

xs = DateTime(2020,1,1):Hour(1):DateTime(2020,1,2)
xs_unix = datetime2unix.(xs)
ys = 1:25

scatter!(ax, xs_unix, ys)
vspan!(ax, xs_unix[1], xs_unix[10])

Last updated: May 17 2025 at 04:42 UTC