AlgebraOfGraphics.jl icon indicating copy to clipboard operation
AlgebraOfGraphics.jl copied to clipboard

Time axis, including date and hours/minutes/seconds

Open lazarusA opened this issue 5 months ago • 2 comments

Currently if we do, only a date format with year/month/day is shown, which then when zoom-ing is less useful, because we cannot see the hours a those scales. Any workaround ?

using AlgebraOfGraphics, Dates
dates = DateTime("2007-01-01T00:00:00"):Hour(1):DateTime("2010-01-01T00:00:00") |> collect
ts1 = cumsum(randn(length(dates)))
ts2 = cumsum(randn(length(dates)))
df = (; dates, ts1, ts2)
plt = data(df) *
    mapping(:dates, [:ts1, :ts2] .=> "value", color=dims(1) => renamer(["time1", "time2"]) => "series ") * visual(Lines)
draw(plt)

Image

lazarusA avatar May 09 '25 07:05 lazarusA