How can I set the xticks
in this recipe?
import Dates
import TimeSeries
using CairoMakie
using PlotUtils: optimize_datetime_ticks
dates = Dates.DateTime(2018, 1, 1):Dates.Day(1):Dates.DateTime(2018, 12, 31)
data = TimeSeries.TimeArray(dates, cumsum(randn(length(dates))))
@recipe(MyTimeSeries, ta) do scene
Theme()
end
function Makie.plot!(plot::MyTimeSeries)
data = to_value(plot[:ta])
for i in 1:size(data,2)
lines!(plot, Dates.value.(TimeSeries.timestamp(data)), TimeSeries.values(data)[:,i], label=string(TimeSeries.colnames(data)[i]))
end
dateticks = optimize_datetime_ticks(Dates.value.(extrema(data |> TimeSeries.timestamp))...)
# TODO:
plot
end
begin
f = Figure()
ax = Axis(f[1, 1])
mytimeseries!(ax, data)
f
end