Format date axis

I only want to show the month and day like mm-01 for each month, excluding the year. How can I do that?

using Dates, AlgebraOfGraphics
let dates = Date(2010,1,1):Day(1):Date(2010,12,31)
p = data((dates=dates, values=randn(length(dates)))) * mapping(:dates, :values) * visual(Scatter)
draw(p; axis=(;xtickformat=...))
end

Try this:

dateticks = AlgebraOfGraphics.datetimeticks(x -> Dates.format(x, dateformat"mm-dd"), months)
draw(p; axis=(;xticks=dateticks))
1 Like